Code: Select all
n$="1234567890"
Debug ValF(n$) ; Returns 1234567936.0
Code: Select all
n$="1234567890"
n.f=ValF(n$)
Debug n ; Returns 1234567936.0
Code: Select all
n$="1234567890"
Debug ValF(n$) ; Returns 1234567936.0
Code: Select all
n$="1234567890"
n.f=ValF(n$)
Debug n ; Returns 1234567936.0
If there is precision to only 7 digits the 1234567890.0 shows which digit is the last accurate one. So if you convert the string "1234567890" you will get precision in the first 7 digits and the rest are less precise (garbage) 1234567936.0 . The less precise ones are due to limitations converting binary to decimal, i.e. 4 binary digits %0100 are only accurate to 1 decimal digit because they represent values of 0 to 15. So can only represent the first decimal place accurately (0 to 9), the second decimal place can only be represented from 0 to 5 and so it is inaccurate. If you increase the # of bits, and include an exponent you can see why there is a limitation with the floats and doubles.PB wrote:But there's no decimal points in 1234567890, though. Well, to be technical
it's 1234567890.0 then, but that's only 1 decimal point. What am I not
understanding here?