Re: Floating point issue in sbcl 1.0.10?
- From: Kamen TOMOV <kamen@xxxxxxxxxxx>
- Date: Wed, 31 Oct 2007 02:47:11 +0200
On Wed, Oct 31 2007, steven.w.levine@xxxxxxxxx wrote:
As a lisp newbie, I'm sorry if this one is obvious. However, I'm a
bit puzzled by the following executed from the prompt:
* (- 1234.56 4.57)
1229.9901
Your question is ambiguous - are you asking about the floating point
precision or about multiplication not happening?
Rainer answered in the former question so I will answer the latter:
The following:
* (- 1234.56 4.57)
when written in the REPL:
1. Evaluates the variable *
2. Evaluates the provided FP form
3. Prints the result of the last form
If you want to do multiplication you should use the function * this
way:
(* (- 1234.56 4.57) 3)
The symbol * is a variable. You can learn about it here:
http://www.lisp.org/HyperSpec/Body/var_stcm_ststcm_ststst.html
--
Камен
.
- Follow-Ups:
- Re: Floating point issue in sbcl 1.0.10?
- From: steven . w . levine
- Re: Floating point issue in sbcl 1.0.10?
- References:
- Floating point issue in sbcl 1.0.10?
- From: steven . w . levine
- Floating point issue in sbcl 1.0.10?
- Prev by Date: Re: Learning Lisp in Linux?
- Next by Date: Re: Lisp on Leopard
- Previous by thread: Re: Floating point issue in sbcl 1.0.10?
- Next by thread: Re: Floating point issue in sbcl 1.0.10?
- Index(es):
Relevant Pages
|
|