axiom-math
[Top][All Lists]
Advanced

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

[Axiom-math] Re: [open-axiom-devel] [Fwd: Re: Greet and Query about a Bu


From: Martin Rubey
Subject: [Axiom-math] Re: [open-axiom-devel] [Fwd: Re: Greet and Query about a Bug]
Date: 25 Sep 2007 20:47:57 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

address@hidden writes:

> Dear Dr. Gabriel Dos Reis , how are you
>       I find a bug about open axiom
>       a := 28 - 8*sqrt(6)
>       a < 0 will return true
>       in fact it should be false
>       Why < is wrong? What cause the problem?
>  Thanks!
> Weiqin Ma

It's not really a bug.

a := 28 - 8*sqrt(6)

is an "AlgebraicNumber" and for reasons I do not quite understand,
AlgebraicNumber does not have mathematical "<". (It does have mathematical "="
though.)  It only uses an internal hash ordering, in fact, the ordering is the
same as in EXPR INT.

Thus, do not be surprised that axiom says:

(1) -> %pi < %e

   (1)  true
                                                                Type: Boolean

Fortunately, axiom has an extremely powerful domain "RealClosure", which does
what you need:

(2) -> R ==> RECLOS FRAC INT
                                                                   Type: Void
(3) -> a := 28 - 8*sqrt(6, 2)$R

            +-+
   (3)  - 8\|6  + 28
                                           Type: RealClosure Fraction Integer
(4) -> a < 0

   (4)  false
                                                                Type: Boolean

Martin





reply via email to

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