Page 1 of 1

Posted: Sat Mar 08, 2003 1:30 am
by BackupUser
Restored from previous forum. Originally posted by Andre.

Someone sent me this test code (little modified by me):

Code: Select all

DefType.f 
v=3568464845
y=3447 
x=v/y 
MessageRequester("Calc",StrF(x),0)
What is the exact possible value range of float variables? (Manual says "unlimited".)

Regards
André

*** German PureBasic Support ***

Posted: Sat Mar 08, 2003 10:09 pm
by BackupUser
Restored from previous forum. Originally posted by geoff.

I don't think this is a range problem.

I think it's a string to float conversion bug for the 3568464845.

Single floats give an accuracy of about 6 decimal digits in the number range 1E-35 to 1e35
(ie 1 followed by 35 zeros at the high end)

Doubles give an accuracy of about 15 decimal digits in the number range 1e-300 to 1e300.

The exact values depend on the implementation used.

On a modern processor with integrated hardware co-processor there is negligible speed penalty in using doubles for all floating point calculations.