▲ | OskarS 2 days ago | ||||||||||||||||
Couldn't resist checking what math.h does for floats and doubles on godbolt, it returns slightly above 9, but curiously not exactly equal to any answer in that list [1]. Maybe not that surprising, these transcendental functions are always iffy in the last digits. | |||||||||||||||||
▲ | chongli 2 days ago | parent | next [-] | ||||||||||||||||
I would be really surprised if any physical calculator used binary floating point numbers instead of binary-coded decimal. The appearance of repeating bits even for relatively simple decimal numbers like 0.1 is likely to confuse and annoy a calculator user expecting an exact answer. | |||||||||||||||||
| |||||||||||||||||
▲ | masfuerte 2 days ago | parent | prev | next [-] | ||||||||||||||||
CORE-MATH provides correctly rounded transcendental functions. (Though that doesn't mean that this calculation will return exactly 9. And I haven't tried it.) | |||||||||||||||||
▲ | avipars 2 days ago | parent | prev [-] | ||||||||||||||||
chalk it up to floating point accuracy |