Discussion:
[Axiom-math] Re: [open-axiom-devel] [Fwd: Re: Greet and Query about a Bug]
Martin Rubey
2007-09-25 18:47:57 UTC
Permalink
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

Loading...