>I'm using:
>
>set decimals to 18
>?5000.3 + 0.6
>
>The result is: 5000.900000000001000000 instead of simply 5000.900000000000000000
>
>Someone could explain me why?
Fractional numbers with the exception of currency, which uses a fixed precision BCD format, are stored as floating point numbers, which do not correspond precisely to fixed decimal representation. If you have very large numbers (on the order of 10^18 for example) the precision of floating point numbers won't allow you to discern the difference between two numbers where the units (the digit immediately to the left of the decimal place) is different. try the following to see how floating point representation is not adequate for very large numbers, or for extreme precsion:
a = 123456789012345678
for j = 1 to 100
if a # a + j
exit
endif
endfor
? j
If you need extreme, extended precision, you need to use another language with a data type that can handle such extremes of precision - languages that have very large BCD representations, or use more precise floating point formats such as C, FORTRAN and COBOL (the PACKED DECIMAL representations can handle extreme precision if you make the fields big enough) are better choices.