|
Authored by: Nick_UK on Friday, March 29 2013 @ 07:23 AM EDT |
Yes, but it is still maths. Remember, all these algorithms etc. where around
before computers, and using boolian/fpu/floating point is still basic maths
algorithms.
Nick[ Reply to This | Parent | # ]
|
|
Authored by: jesse on Friday, March 29 2013 @ 08:18 AM EDT |
This is done to try to maintain the precision of the numbers.
Now the issues still rises, but not in that form. It would be necessary that the
"a + b" be computed in one place, "a - b" computed in a
second place, then the results added together in a third.
The place problems really occur expressions like "a < 1.85"... and
a is supposed to equal 1.85.
In these cases the constant is converted to binary by the compiler.. and the
variable is converted by a runtime system operating under different
requirements.
I used to have to multipy the "a" value by 100 (and convert to
integer) to compare to 185. That worked, where using floating point would not.
[ Reply to This | Parent | # ]
|
|
|
|
|