[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] Re: *read-default-float-format* in SBCL/wh-sandbox
From: |
Waldek Hebisch |
Subject: |
[Axiom-developer] Re: *read-default-float-format* in SBCL/wh-sandbox |
Date: |
Wed, 27 Jun 2007 02:46:10 +0200 (CEST) |
> Le samedi 23 juin 2007 ? 21:08 +0200, Waldek Hebisch a écrit :
> > Do you think we should set *read-default-float-format*
> > to T? I must admit that in Lisp/boot sources I would prefer to
> > explicitly specify double precision (when needed), while for
> > Spad/input we are (or should be) using our own routines anyway.
>
> I agree but I see two issues here, the first one is that when
> $useBFasDefault is set to false Axiom creates single-floats and
> therefore computations are done over single-floats. You can try in the
> interpreter :
>
> )bo $useBFasDefault := false
>
> 1.0/3*float(3,0,10)@DoubleFloat
>
> => 1.0000000298023224d0
>
>
> This can be fixed by modifying the function MAKE-FLOAT in macros.lisp
> (replacing the 'e' by a 'd' in the format) . This feature - using
> DoubleFloat by default instead of Float - is very handy when you write a
> Spad file where computations are done on DoubleFloat : you don't have to
> coerce each Float and the generated Lisp file is cleaner.
>
> The other issue is how a DoubleFloat is displayed. Since we let Lisp
> display it and *read-default-float-format* is set to single-float the
> 'd' character is added to its printed representation.
>
> I think that in the mean time (as far as the Lisp "formatter" is used to
> displays double-floats) *read-default-float-format* should be set to
> double-float.
>
OK. As of revision 645 *read-default-float-format* should be set to
double-float. This was somewhat tricky with sbcl -- if one just
sets value it seem to get lost after restarting the image (IIUC
you wrote about this problem). So I introduced an init function
which is called before toplevel. In the process I think that
I also fixed the )fin issue (typing )fin now gives the sbcl
prompt).
--
Waldek Hebisch
address@hidden