/usr/share/axiom-20170501/src/algebra/TOOLSIGN.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | )abbrev package TOOLSIGN ToolsForSign
++ Author: Manuel Bronstein
++ Date Created: 25 August 1989
++ Date Last Updated: 26 November 1991
++ Description:
++ Tools for the sign finding utilities.
ToolsForSign(R) : SIG == CODE where
R : Ring
SIG ==> with
sign : R -> Union(Integer, "failed")
++ sign(r) \undocumented
nonQsign : R -> Union(Integer, "failed")
++ nonQsign(r) \undocumented
direction : String -> Integer
++ direction(s) \undocumented
CODE ==> add
if R is AlgebraicNumber then
nonQsign r ==
sign((r pretend AlgebraicNumber)::Expression(
Integer))$ElementaryFunctionSign(Integer, Expression Integer)
else
nonQsign r == "failed"
if R has RetractableTo Fraction Integer then
sign r ==
(u := retractIfCan(r)@Union(Fraction Integer, "failed"))
case Fraction(Integer) => sign(u::Fraction Integer)
nonQsign r
else
if R has RetractableTo Integer then
sign r ==
(u := retractIfCan(r)@Union(Integer, "failed"))
case "failed" => "failed"
sign(u::Integer)
else
sign r ==
zero? r => 0
r = 1 => 1
r = -1 => -1
"failed"
direction st ==
st = "right" => 1
st = "left" => -1
error "Unknown option"
|