login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for #405 ContinuedFraction and Polynomial Domains revision 7 of 7

1 2 3 4 5 6 7
Editor: japp
Time: 2008/10/23 06:20:54 GMT-7
Note:

removed:
-
-From page Wed Dec 12 14:17:18 -0800 2007
-From: page
-Date: Wed, 12 Dec 2007 14:17:18 -0800
-Subject: Specify version of Axiom
-Message-ID: <20071212141718-0800@axiom-wiki.newsynthesis.org>
-
-Axiom Version:  => friCAS-20071109 
-
-
-From page Wed Dec 12 14:40:06 -0800 2007
-From: page
-Date: Wed, 12 Dec 2007 14:40:06 -0800
-Subject: chech change to version
-Message-ID: <20071212144006-0800@axiom-wiki.newsynthesis.org>
-
-Axiom Version: /usr/local/lib/axiom/target/x86_64-unknown-linux => OpenAxiom-20071209 
-
-
-From page Wed Dec 12 14:45:27 -0800 2007
-From: page
-Date: Wed, 12 Dec 2007 14:45:27 -0800
-Subject: specify version of Axiom
-Message-ID: <20071212144527-0800@axiom-wiki.newsynthesis.org>
-
-
-testing

Submitted by : kratt6 at: 2007-12-05T06:41:43-08:00 (16 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

Consider

fricas
(1) -> d := continuedFraction(0,[1 for i in 1..], [1 for i in 0..])$CONTFRAC INT

\label{eq1}\zag{1}{1}+ \zag{1}{1}+ \zag{1}{1}+ \zag{1}{1}+ \zag{1}{1}+ \zag{1}{1}+ \zag{1}{1}+ \zag{1}{1}+ \zag{1}{1}+ \zag{1}{1}+ \ldots(1)
Type: ContinuedFraction?(Integer)
fricas
2*d

\label{eq2}1 + \zag{1}{4}+ \zag{1}{4}+ \zag{1}{4}+ \zag{1}{4}+ \zag{1}{4}+ \zag{1}{4}+ \zag{1}{4}+ \zag{1}{4}+ \zag{1}{4}+ \zag{1}{4}+ \ldots(2)
Type: ContinuedFraction?(Integer)

so far, so good. But changing the domain to CONTFRAC UP(x, FRAC INT) makes axiom crash.

The problem appears to be, that INT is ordered, while UP(x, FRAC INT) is not. In contfrac.spad we find:

    eucWhole(a: Q): R == numer a quo denom a

    eucWhole0(a: Q): R ==
        isOrdered =>
            n := numer a
            d := denom a
            q := n quo d
            r := n - q*d
            if r < 0 then q := q - 1
            q
        eucWhole a

If R is INT, eucWhole0(4/3) yields 1, in the other case it returns 4/3. I haven't been able to investigate further yet, though.

Martin