|
Posted by Gordon Burditt on 12/05/05 17:03
>Variables are held to s certain degree of precision. 200.15 cannot be
>held accurately as a normal binary number, for example, so errors can
>occur.
>
>Use bcsub(200.15,200,n) where n is the number of decimal places you
>want.
Any attempt to round to "a number of decimal places" will virtually
guarantee roundoff error. There are very few non-integer decimal
numbers which can be represented exactly in binary floating
point. All of them end in 5 (plus trailing zeroes).
Gordon L. Burditt
Navigation:
[Reply to this message]
|