[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Axiom-developer] Compiler coercion and DoubleFloat
From: |
Bill Page |
Subject: |
RE: [Axiom-developer] Compiler coercion and DoubleFloat |
Date: |
Mon, 27 Feb 2006 19:00:07 -0500 |
Grég,
On February 27, 2006 6:05 PM you wrote:
> ...
> In fact, the parser, when it encounters a real number,
> returns integer part, fractional part, length of fractional part
> and exponent and call MAKE-FLOAT. MAKE-FLOAT returns mantissa,
> exponent (in base 10) and a "property" attached |:BF:|
> (for big float) if $useBFasDefault is true (its default value).
> postBigFloat will return, later,
> ((|elt| (|Float|) |float|) 23538526683701998541 -2 10)
>
> But if $useBFasDefault is false MAKE-FLOAT returns a lisp
> double-float.
>
> So i add, at the beginning of the code
>
> )boot $useBFasDefault:=false
>
> the code is:
> two4: R := 24.0
> fourty: R := 40.0
> exp40: R := 235385266837019985.41
>
> and the compiler output is:
>
> (SEQ (LET (|:| |two4| (|DoubleFloat|)) 24.0)
> (LET (|:| |fourty| (|DoubleFloat|)) 40.0)
> (LET (|:| |exp40| (|DoubleFloat|)) 2.3538526683702E17)
>
That's cool.
Does '$useBFasDefault:=false' globally change the representation
of DoubleFloat to lisp double-float?
What is the advantage of lisp double-float over Axiom's
DoubleFloat? Higher precision?
(1) -> precision()$Float
(1) 68
Type: PositiveInteger
Precisioni of Float is adjustable but the following are fixed.
(2) -> precision()$DoubleFloat
(2) 53
Type: PositiveInteger
(3) -> precision()$MachineFloat
(3) 16
Type: PositiveInteger
-------
If I set $useBFasDefault in the Axiom interpreter I get the
following error:
(1) -> )boot $useBFasDefault:=false
(SPADLET |$useBFasDefault| NIL)
Value = NIL
(1) -> two4: DoubleFloat := 24.0
>> System error:
Caught fatal error [memory may be damaged]
protected-symbol-warn called with (NIL)
-------
So I suppose you have some specific application of this in the
SPAD compiler?
Regards,
Bill Page.