diff options
author | dos-reis <gdr@axiomatics.org> | 2011-08-10 23:30:02 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-08-10 23:30:02 +0000 |
commit | 7c7d44f1dc284e4c4e231d97023aa87ecd5f8e44 (patch) | |
tree | db90d375dde6576789ad23ae39dc5de66b148e57 /src/algebra | |
parent | e6b1636fe3b19b148f347f6b9f00642db83c5ddc (diff) | |
download | open-axiom-7c7d44f1dc284e4c4e231d97023aa87ecd5f8e44.tar.gz |
* algebra/float.spad.pamphlet (Float): Tidy.
* algebra/fortmac.spad.pamphlet (MachineInteger): Likewise.
* algebra/fspace.spad.pamphlet (FunctionSpace): Likewise.
* algebra/integer.spad.pamphlet (Integer): Likewise.
* algebra/mkfunc.spad.pamphlet (InputForm): Likewise.
* algebra/newpoly.spad.pamphlet (RecursivePolynomialCategory):
Likewise.
* input/knot.input.pamphlet: Likewise.
* input/knot2.input.pamphlet: Likewise.
* input/mult3d.input.pamphlet: Likewise.
* input/multKnot.input.pamphlet: Likewise.
* input/r21bugsbig.input.pamphlet: Likewise.
* input/tutchap2.input.pamphlet: Likewise.
Diffstat (limited to 'src/algebra')
-rw-r--r-- | src/algebra/float.spad.pamphlet | 20 | ||||
-rw-r--r-- | src/algebra/fortmac.spad.pamphlet | 4 | ||||
-rw-r--r-- | src/algebra/fspace.spad.pamphlet | 2 | ||||
-rw-r--r-- | src/algebra/integer.spad.pamphlet | 5 | ||||
-rw-r--r-- | src/algebra/mkfunc.spad.pamphlet | 2 | ||||
-rw-r--r-- | src/algebra/newpoly.spad.pamphlet | 8 |
6 files changed, 20 insertions, 21 deletions
diff --git a/src/algebra/float.spad.pamphlet b/src/algebra/float.spad.pamphlet index ffafb040..75bc17a5 100644 --- a/src/algebra/float.spad.pamphlet +++ b/src/algebra/float.spad.pamphlet @@ -819,7 +819,7 @@ Float(): fixed f == zero? f => "0.0" zero? exponent f => - padFromRight concat(convert(mantissa f)@S, ".0") + padFromRight concat(string mantissa f, ".0") negative? f => concat("-", fixed abs f) d := if OUTPREC() = -1 then digits()::I else OUTPREC() -- g := convert10(abs f,digits); m := g.mantissa; e := g.exponent @@ -830,7 +830,7 @@ Float(): if -e > OUTPREC() and -e < 2*digits()::I then g := normalize10(g,l+e+OUTPREC()) m := g.mantissa; e := g.exponent - s := convert(m)@S; n := #s; o := e+n + s := string m; n := #s; o := e+n p := if OUTPREC() = -1 then n::I else OUTPREC() t:S if e >= 0 then @@ -855,15 +855,15 @@ Float(): negative? f => concat("-", floating abs f) t:S := if zero? SPACING() then "E" else " E " zero? exponent f => - s := convert(mantissa f)@S - concat ["0.", padFromLeft s, t, convert(#s)@S] + s := string mantissa f + concat ["0.", padFromLeft s, t, string(#s)] -- base conversion to decimal rounded to the requested precision d := if OUTPREC() = -1 then digits()::I else OUTPREC() g := convert10(f,d); m := g.mantissa; e := g.exponent -- I'm assuming that length10 m = # s given n > 0 - s := convert(m)@S; n := #s; o := e+n + s := string m; n := #s; o := e+n s := padFromLeft s - concat ["0.", s, t, convert(o)@S] + concat ["0.", s, t, string o] general(f) == zero? f => "0.0" @@ -871,15 +871,15 @@ Float(): d := if OUTPREC() = -1 then digits()::I else OUTPREC() zero? exponent f => d := d + 1 - s := convert(mantissa f)@S + s := string mantissa f OUTPREC() ~= -1 and (e := #s) > d => t:S := if zero? SPACING() then "E" else " E " - concat ["0.", padFromLeft s, t, convert(e)@S] + concat ["0.", padFromLeft s, t, string e] padFromRight concat(s, ".0") -- base conversion to decimal rounded to the requested precision g := convert10(f,d); m := g.mantissa; e := g.exponent -- I'm assuming that length10 m = # s given n > 0 - s := convert(m)@S; n := #s; o := n + e + s := string m; n := #s; o := n + e -- Note: at least one digit is displayed after the decimal point -- and trailing zeroes after the decimal point are dropped if positive? o and o <= max(n,d) then @@ -896,7 +896,7 @@ Float(): -- print using E format written 0.mantissa E exponent t := padFromLeft rightTrim(s,zero) s := if zero? SPACING() then "E" else " E " - concat ["0.", t, s, convert(e+n)@S] + concat ["0.", t, s, string(e+n)] outputSpacing n == SPACING() := n outputFixed() == (OUTMODE() := "fixed"; OUTPREC() := -1) diff --git a/src/algebra/fortmac.spad.pamphlet b/src/algebra/fortmac.spad.pamphlet index 92a1c9c7..5684244c 100644 --- a/src/algebra/fortmac.spad.pamphlet +++ b/src/algebra/fortmac.spad.pamphlet @@ -54,7 +54,7 @@ MachineInteger(): Exports == Implementation where coerce(u:Integer):$ == import S abs(u) > MAXINT => - message: S := concat [convert(u)@S," > MAXINT(",convert(MAXINT)@S,")"] + message: S := concat [string u," > MAXINT(",string MAXINT,")"] error message per u @@ -208,7 +208,7 @@ MachineFloat(): Exports == Implementation where checkExponent(u:$):$ == exponent(u) < EMIN or exponent(u) > EMAX => message :S := concat(["Exponent out of range: ", - convert(EMIN)@S, "..", convert(EMAX)@S])$S + string EMIN, "..", string EMAX])$S error message u diff --git a/src/algebra/fspace.spad.pamphlet b/src/algebra/fspace.spad.pamphlet index 684448f0..2f1ffe10 100644 --- a/src/algebra/fspace.spad.pamphlet +++ b/src/algebra/fspace.spad.pamphlet @@ -613,7 +613,7 @@ FunctionSpace(R: SetCategory): Category == Definition where characteristic == characteristic$R coerce(k:K):% == k::MP::% - symsub(sy, i) == concat(string sy, convert(i)@String)::SY + symsub(sy, i) == concat(string sy, string i)::SY numerator x == numer(x)::% eval(x:%, s:SY, n:N, f:% -> %) == eval(x,[s],[n],[f first #1]) eval(x:%, s:SY, n:N, f:List % -> %) == eval(x, [s], [n], [f]) diff --git a/src/algebra/integer.spad.pamphlet b/src/algebra/integer.spad.pamphlet index 9052e19d..050009ea 100644 --- a/src/algebra/integer.spad.pamphlet +++ b/src/algebra/integer.spad.pamphlet @@ -70,7 +70,7 @@ IntegerSolveLinearPolynomialEquation(): C ==T ++ Description: \spadtype{Integer} provides the domain of arbitrary precision ++ integers. -Integer: Join(IntegerNumberSystem, ConvertibleTo String) with +Integer: IntegerNumberSystem with canonical ++ mathematical equality is data structure equality. canonicalsClosed @@ -137,10 +137,9 @@ Integer: Join(IntegerNumberSystem, ConvertibleTo String) with convert(x:%):Float == coerce(x)$Float convert(x:%):DoubleFloat == coerce(x)$DoubleFloat convert(x:%):InputForm == convert(x)$InputForm - convert(x:%):String == %i2s x latex(x:%):String == - s : String := convert x + s := %i2s x -%icst1 < x and x < 10 => s %strconc("{", %strconc(s, "}")) diff --git a/src/algebra/mkfunc.spad.pamphlet b/src/algebra/mkfunc.spad.pamphlet index 288a3a82..91f99664 100644 --- a/src/algebra/mkfunc.spad.pamphlet +++ b/src/algebra/mkfunc.spad.pamphlet @@ -122,7 +122,7 @@ InputForm(): flatten0(s, sy, n) == atom? s => [nil(), s] - a := convert(concat(string sy, convert(n)@String)::Symbol)@% + a := convert(concat(string sy, string n)::Symbol)@% l := destruct s l2 := [flatten0(x, sy, n := n+1) for x in rest l] [concat(concat [u.lst for u in l2], conv([convert( diff --git a/src/algebra/newpoly.spad.pamphlet b/src/algebra/newpoly.spad.pamphlet index 459ef7b3..65bdcde7 100644 --- a/src/algebra/newpoly.spad.pamphlet +++ b/src/algebra/newpoly.spad.pamphlet @@ -1367,7 +1367,7 @@ RecursivePolynomialCategory(R:Ring, E:OrderedAbelianMonoidSup, V:OrderedSet): Ca then convert(pol:$):String == - ground?(pol) => convert(retract(ground(pol))@INT)@String + ground?(pol) => string(retract(ground(pol))@INT) ipol : $ := init(pol) vpol : V := mvar(pol) dpol : NNI := mdeg(pol) @@ -1392,7 +1392,7 @@ RecursivePolynomialCategory(R:Ring, E:OrderedAbelianMonoidSup, V:OrderedSet): Ca then sdpol := empty()$String else - sdpol := concat("**",convert(convert(dpol)@INT)@String )$String + sdpol := concat("**",string(convert(dpol)@INT))$String if zero? tpol then stpol := empty()$String @@ -1402,9 +1402,9 @@ RecursivePolynomialCategory(R:Ring, E:OrderedAbelianMonoidSup, V:OrderedSet): Ca n := retract(ground(tpol))@INT if positive? n then - stpol := concat(" +",convert(n)@String)$String + stpol := concat(" +", string n)$String else - stpol := convert(n)@String + stpol := string n else stpol := convert(tpol)@String if not member?((stpol.1)::String,["+","-"])$(List String) |