Re: Floating point issue in sbcl 1.0.10?



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


--
Камен
.



Relevant Pages

  • Re: emacs run-scheme
    ... for windows xp and others will not. ... MzScheme shows it's repl, ... works in a command prompt) do not show their repl ... matches the emacs variable comint-prompt-regexp. ...
    (comp.lang.scheme)
  • emacs run-scheme
    ... Can anyone tell me why some repl will show in cmuscheme on emacs21.3 ... for windows xp and others will not. ... MzScheme shows it's repl, ... works in a command prompt) do not show their repl ...
    (comp.lang.scheme)
  • Re: highest precision possible?
    ... Use the variable precision toolbox. ... Type doc vpa at the command ...
    (comp.soft-sys.matlab)