D
David Veeneman
I'm working on a project that uses floating-point values (doubles), and I'm
being driven crazy by something pretty basic. I understand that it's in the
nature of floating-point calculations to produce values like
0.10000000000000003, when what I really want is 0.1. But is there any way to
eliminate that digit at the end? I've tried rounding, but that simply moves
the digit to the least significant position, such as 0.1000003.
Failing that, can anyone recommend any good online articles for dealing with
floating-point issues, beyond using Epsilon for zero comparisons? Thanks in
advance.
David Veeneman
Foresight Systems
being driven crazy by something pretty basic. I understand that it's in the
nature of floating-point calculations to produce values like
0.10000000000000003, when what I really want is 0.1. But is there any way to
eliminate that digit at the end? I've tried rounding, but that simply moves
the digit to the least significant position, such as 0.1000003.
Failing that, can anyone recommend any good online articles for dealing with
floating-point issues, beyond using Epsilon for zero comparisons? Thanks in
advance.
David Veeneman
Foresight Systems