diff options
author | dos-reis <gdr@axiomatics.org> | 2011-10-24 01:08:31 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-10-24 01:08:31 +0000 |
commit | cef0dd1a5a078a0d8d6b635a2c247c81c00b2a12 (patch) | |
tree | 30518cd65d39163d32898da36d58c925f58e270f /src/algebra/polycat.spad.pamphlet | |
parent | 6a7022d0c0be54f3411ee07663765f60691c5f0c (diff) | |
download | open-axiom-cef0dd1a5a078a0d8d6b635a2c247c81c00b2a12.tar.gz |
* interp/compiler.boot (compOrCroak1): Drop last argument. Tidy.
(mostSpecificTriple): New.
(compAtomWithModemap): Use it to resolve ambiguous constants.
(formatConstantCandidates): New.
(compForm1): Do try to compile constants 0 and 1 with compToApply.
* algebra/polycat.spad.pamphlet (FiniteAbelianMonoidRing)
[binomThmExpt]: Tidy.
(UnivariatePolynomialCategory) [pseudoDivide]: Likewise.
* algebra/float.spad.pamphlet (Float) [log]: Specificy type for
local variable `l'.
* interp/format.boot (formatUnabbreviatedSig): Handle constants.
Diffstat (limited to 'src/algebra/polycat.spad.pamphlet')
-rw-r--r-- | src/algebra/polycat.spad.pamphlet | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/algebra/polycat.spad.pamphlet b/src/algebra/polycat.spad.pamphlet index 4347438f..b56c9a97 100644 --- a/src/algebra/polycat.spad.pamphlet +++ b/src/algebra/polycat.spad.pamphlet @@ -142,7 +142,10 @@ FiniteAbelianMonoidRing(R:Ring, E:OrderedAbelianMonoid): Category == bincoef: Integer powl: List(%):= [x] for i in 2..nn repeat powl:=[x * powl.first, :powl] - yn:=y; ans:=powl.first; i:=1; bincoef:=nn + yn := y + ans := powl.first + i: Integer := 1 + bincoef := nn for xn in powl.rest repeat ans:= bincoef * xn * yn + ans bincoef:= (nn-i) * bincoef quo (i+1); i:= i+1 @@ -918,7 +921,8 @@ UnivariatePolynomialCategory(R:Ring): Category == - pseudoRemainder(p, q)) exquo q)::% pseudoDivide(p, q) == - (n := degree(p)::Integer - degree q + 1) < 1 => [1, 0, p] + n: Integer := degree(p)::Integer - degree q + 1 + n < 1 => [1, 0, p] prem := pseudoRemainder(p, q) lc := leadingCoefficient(q)**(n::NonNegativeInteger) [lc,((lc*p - prem) exquo q)::%, prem] |