“Eps” (Solution)
Last updated
Was this helpful?
Last updated
Was this helpful?
The Double
numbers use the specification and they are stored in 64-bit binary format. Unfortunately, most decimal non-integer numbers can not be represented in the binary format. This fact affects affects to performing of arithmetic operations with floating-point numbers:
The proper way to compare double
numbers is comparing with some epsilon. An example: