Hi guys
in newlisp docs
(format "%e" 123456789) → "1.234568e+08"
But when I reverse this
> (int 1.234568e+08)
123456800
Got the different results
Why is this happend?
---
newLISP v.10.4.4 on OSX IPv4/6. 64bits
> (format "%e" 123456789)
"1.234568e+008"
> (format "%.6e" 123456789)
"1.234568e+008"
> (int 1.234568e+008)
123456800
> (format "%.7e" 123456789)
"1.2345679e+008"
> (int 1.2345679e+008)
123456790
> (format "%.8e" 123456789)
"1.23456789e+008"
> (int 1.23456789e+008)
123456789
Please read format (//http).
(format "%e" 123456789)
Without precision parameter it uses a default precision, so t gets rounded.
(Not mentioned in the doc)
oh God
thanks guys