Page 1 of 1

How to set calculation with the highest possible accuracy?

Posted: Tue Dec 18, 2012 1:59 am
by Eugene Lutsenko
How to set calculation with the highest possible accuracy? I used SET DECIMALS TO 15, but I have such impression that 0.99 is perceived as 1. Please...

Re: How to set calculation with the highest possible accurac

Posted: Tue Dec 18, 2012 4:41 am
by Tom
SET DECIMALS has nothing to do with calculation precision. SET DECIMALS and SET FIXED just set the number of digits behind the comma when numbers are displayed (maybe using "? in CRT mode).

Since Xbase++ only knows the datatype "numeric", which always is a 64-bit floating number (IEEE), calculations should be almost precise for up to 16 digits behind the comma. When it comes to display numbers, a value like 0.9999999999 may show up as 1.0, depending on the format.