axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] [Richard Fateman <address@hidden>] Re: [Maxima] st


From: Gabriel Dos Reis
Subject: Re: [Axiom-developer] [Richard Fateman <address@hidden>] Re: [Maxima] strange behaviour with simple decimals / Axiom
Date: 11 Apr 2007 21:45:08 -0500

"Bill Page" <address@hidden> writes:

| Quoting Gabriel Dos Reis <address@hidden>:
| 
| > ... Bill Page wrote:
| > | (%i2) 1.96 - 1.4^2;
| > | (%o2)                       2.2204460492503131E-16
| > | (%i3)
| >
| > I believe that can explained by the fact that Axiom uses the host
| > "long double" C datatype for DoubleFloat whereas Maxima must be
| > using the more conventional and reliable "double" C datatype.
| 
| No. By default Axiom uses it's own adjustable precision floating
| point. See domain Float and the 'precision()' function. If you want
| DoubleFloat you would write:

[...]

| Of the "machine" float:
| 
| (5) -> A:=1.4::MachineFloat
| 
|     (5)  1.4
|                                        Type: MachineFloat
| 
| (6) -> A^2
| 
|     (6)  1.96
|                                        Type: MachineFloat
| 
| (7) -> B:=1.96::MachineFloat
| 
|     (7)  1.96
|                                        Type: MachineFloat
| 
| (8) -> B-A^2
| 
|     (8)  0.2220446049 250313 E -15
|                                        Type: MachineFloat

which agrees with what Maxima computes.

-- Gaby




reply via email to

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