number output precision

For the Compleat Fan
Locked
cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

number output precision

Post by cormullion »

My understanding is that newLISP outputs numbers (FP) to about 9 or 10 figures, although it stores up to about 15 internally:

Code: Select all

(set 't (sin 1.5))
0.9974949866
(format "%.15f" t)
"0.997494986604054"
It would be nice if there was a way to set the default output up to 15. It's sometimes less convenient to use format as well (think 'using newLISP as calculator....' ;-) )

Cyril
Posts: 183
Joined: Tue Oct 30, 2007 6:27 pm
Location: Moscow, Russia
Contact:

Re: number output precision

Post by Cyril »

cormullion wrote:It would be nice if there was a way to set the default output up to 15. It's sometimes less convenient to use format as well (think 'using newLISP as calculator....' ;-) )
It would me nice also to borrow the python approach to print at least one digit after decimal separator for float numbers. I am always confused when number looking as integer is printed when I expect float one. I mean 1.0 should be printed as 1.0, not as 1
With newLISP you can grow your lists from the right side!

Locked