From 52fddea19454dc2b9bcb54c6edd5a4cd4f5765a9 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sat, 12 Mar 2011 17:04:43 +0000 Subject: * src/algebra/: Systematically use negative? when comparing for less than 0. --- src/algebra/reclos.spad.pamphlet | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/algebra/reclos.spad.pamphlet') diff --git a/src/algebra/reclos.spad.pamphlet b/src/algebra/reclos.spad.pamphlet index bc6275be..c1359c1b 100644 --- a/src/algebra/reclos.spad.pamphlet +++ b/src/algebra/reclos.spad.pamphlet @@ -244,7 +244,7 @@ RealRootCharacterizationCategory(TheField, ThePols ) : Category == PUB where sign(toTest, rootChar) = 0 negative?(toTest, rootChar) == - sign(toTest, rootChar) < 0 + negative? sign(toTest, rootChar) positive?(toTest, rootChar) == sign(toTest, rootChar) > 0 @@ -703,7 +703,7 @@ RightOpenIntervalRootCharacterization(TheField,ThePolDom) : PUB == PRIV where null(l) => false f := sign(first(l)) for term in rest(l) repeat - if f*term < 0 then return(true) + if negative?(f*term) then return(true) false hasVars(p:P) == @@ -743,7 +743,7 @@ RightOpenIntervalRootCharacterization(TheField,ThePolDom) : PUB == PRIV where <> res :$ := [left,right,leadingMonomial(pol)+reductum(pol)]$Rep -- safe copy while zero?(pol.(res.high)) repeat refine!(res) - while (res.high * res.low < 0 ) repeat refine!(res) + while negative?(res.high * res.low) repeat refine!(res) zero?(pol.(res.low)) => [res.low,res.high,monomial(1,1)-(res.low)::P] res @@ -862,7 +862,7 @@ RightOpenIntervalRootCharacterization(TheField,ThePolDom) : PUB == PRIV where rootChar.low := int rootChar.defPol := monomial(1,1) - int::P rootChar - if (s1*s2 < 0) + if negative?(s1*s2) then rootChar.high := int else @@ -874,7 +874,7 @@ RightOpenIntervalRootCharacterization(TheField,ThePolDom) : PUB == PRIV where int := middle(rootChar) s:= (rootChar.defPol).int * (rootChar.defPol).(rootChar.high) zero?(s) => [int,rootChar.high,monomial(1,1)-int::P] - if s < 0 + if negative? s then [int,rootChar.high,rootChar.defPol] else -- cgit v1.2.3