Re: n accuracy
- From: "Alex Mizrahi" <udodenko@xxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 30 May 2007 11:34:31 +0300
(message (Hello 'Edi)
(you :wrote :on '(Wed, 30 May 2007 09:26:35 +0200))
(
??>> Yesterday I was lisping some statistics so I needed e, considering I
??>> couldn't find it at hyperspec (too much coffein I guess) so I used
??>> (exp 1) => 2.7182818 but author of the stat book seemed to have
??>> different idea about some digits.
EW> This looks like the correct approximation for 8 digits to me.
btw, in CLISP:
[1]> (exp 1l0)
2.7182818284590452354L0
[2]> (exp 1d0)
2.718281828459045d0
[3]> (exp 1.0)
2.7182817
last value looks a bit strange, double and long versions have all digits
correct.
f>>how to tell lisp that my numbers are
f>>long-floats or made my program use bignums.
if this was a question, in CLISP you can control how long long numbers are.
(SETF (EXT:LONG-FLOAT-DIGITS) digits)
to tell that number is long, use 1.0L0 etc.
when i was in the University, i've made numeric DE solving in CLISP using
longer long numbers, and this saved me from some weird errors that other
people with doubles had. but it's a bit slow :).
only change to use bignums is to use only rational arithmetic, no "expt" and
other functions allowed.
)
(With-best-regards '(Alex Mizrahi) :aka 'killer_storm)
"I am everything you want and I am everything you need")
.
- Follow-Ups:
- Re: n accuracy
- From: Barry Margolin
- Re: n accuracy
- References:
- n accuracy
- From: fireblade
- Re: n accuracy
- From: Edi Weitz
- n accuracy
- Prev by Date: Re: n accuracy
- Next by Date: code critique
- Previous by thread: Re: n accuracy
- Next by thread: Re: n accuracy
- Index(es):
Relevant Pages
|