Andrew Beckett
Senior Fellow
Offline
Life, don't talk to me about Life...
Posts: 1742
Bracknell, UK
|
OK, that's just the default print representation of a floating point number in SKILL.
The calculations and storage are actually double precision numbers, but the default is to print them in a compact form, effectively single precision.
If you use:
printf("%.14e\n" num)
it will print to 14 digits.
Or for simple values you want to see at the prompt, or print with println() etc, you can use:
sstatus(fullPrecision t)
This will mean that if you do your example, it will print to much greater precision (14 digits). Note that floating point numbers are actually stored to roughly 15 significant digits (52 bit mantissa, so it's 52*log10(2)). So that's one part in 1e15. With a number which is of the order of 1e-7, the resolution is of the order of 1e-22.
Regards,
Andrew.
|