atof does not return the complete number of the input string
问题:
I am trying to convert a string in lisp to a real number using atof and the
number is truncated. Is there a way to get the complete number?
Command: (atof "1234.34456")
1234.34
解答:
The number is not rounded off internally. The number displayed on the command
line is however. This can be seen in the example from the AutoCAD text window
below. rtos is used to get the internal number returned from atof stored in
variable test. You can use the rtos function to get the complete number when
all the digits need to be seen by the user.
Command: (setq test (atof "0.4732223983"))
0.473222
Command: (rtos test 2 10)
"0.4732223983"
我还是喜欢distof
页:
[1]