axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] Re: *read-default-float-format* in SBCL/wh-sandbox


From: Gregory Vanuxem
Subject: [Axiom-developer] Re: *read-default-float-format* in SBCL/wh-sandbox
Date: Mon, 25 Jun 2007 18:23:51 +0200

Le samedi 23 juin 2007 à 21:08 +0200, Waldek Hebisch a écrit : 
> > Hello Waldek,
> > 
> > *read-default-float-format* is set to single-float in SBCL/wh-sandbox.
> > The problem, I think, is that SBCL does not save the value of this
> > variable when creating a new Lisp image. As far as I know this happens
> > for other variables (not exhaustive of course) *print-escape*
> > *load-verbose* *compile-verbose* *load-print* *compile-print*
> > *print-array*.
> > 
> 
> AFAICS in open source Axiom *read-default-float-format* always was
> set to single-float.  CCL based Axiom set *read-default-float-format*
> to double-float.  GCL uses the same precision for single and
> double floats (and also for long float), so for GCL it does not
> matter very much.

Yes, GCL is buggy from my point of view. I wonder how this is handled in
2.7.

> 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.

[...]

> 
> BTW: If you want to have quiet compilation/loading it is not
> enough to set *load-verbose* and *compile-verbose* to nil.
> One also have to handle various conditions (see for example
> |load_quietly| in axiom-lisp.lisp.pamphlet).

Ok, thanks, I just upgraded.

Greg






reply via email to

[Prev in Thread] Current Thread [Next in Thread]