Code: Select all
> (int 999999999999999999999999999999999999999999.99)
9223372036854775807
Code: Select all
> (bigint 999999999999999999999999999999999999999999.99)
1000000000000000045259160000000000000000000L
AndWhen converting from floating point, rounding errors occur going back and forth between decimal and binary arithmetic.
Code: Select all
> (bigint "1234567890123456789012345678901234567890.123456789")
1234567890123456789012345678901234567890L
it means that needs to be converted to a string first
But,
Code: Select all
> (bigint (string 1234567890123456789012345678901234567890.123456789))
1L
> (string 1234567890123456789012345678901234567890.123456789)
"1.23456789012346e+039123456789"
and also, the result is incorrect!
Distinctly, literal 1234567890123456789012345678901234567890.123456789 to be parsed as two parts "1234567890123456789012345678901234567890." and "123456789"
Code: Select all
> 1234567890123456789012345678901234567890.123456789
1.23456789012346e+039
123456789
Code: Select all
> (setq d 1234567890123456789012345678901234567890.123456789)
ERR: missing argument in function setf
Code: Select all
> 100000000000000000.9876543210123456789
1e+017
456789
> (length "100000000000000000.9876543210123")
32
> 1000000000000000000.9876543210123456789
1e+018
3456789
> 10000000000000000000.9876543210123456789
1e+019
23456789
> 100000000000000000000.9876543210123456789
1e+020
123456789
> 1000000000000000000000.9876543210123456789
1e+021
342391 <----- Where it comes
89
> 10000000000000000000000.9876543210123456789
1e+022
10123456789
> 100000000000000000000000.9876543210123456789
1e+023
210123456789
> 1000000000000000000000000.9876543210123456789
1e+024
3210123456789
> 10000000000000000000000000.9876543210123456789
1e+025
43210123456789
> 100000000000000000000000000.9876543210123456789
1e+026
543210123456789
> 1000000000000000000000000000.9876543210123456789
1e+027
6543210123456789
> 10000000000000000000000000000.9876543210123456789
1e+028
76543210123456789
> 100000000000000000000000000000.9876543210123456789
1e+029
876543210123456789
> 1000000000000000000000000000000.9876543210123456789
1e+030
9876543210123456789L
> 10.1234567890123456789012345678901234567890
10.1234567890123
342391 <----- Where it comes
890