MCPcopy Create free account
hub / github.com/Singular/Singular / abs

Function abs

factory/cf_algorithm.h:116–125  ·  view source on GitHub ↗

inline CanonicalForm abs ( const CanonicalForm & f ) * * abs() - return absolute value of `f'. * * The absolute value is defined in terms of the function * `sign()'. If it reports negative sign for `f' than -`f' is * returned, otherwise `f'. * * This behaviour is most useful for integers and rationals. But * it may be used to sign-normalize the leading coefficient of * arbitrary polyno

Source from the content-addressed store, hash-verified

114 *
115**/
116inline CanonicalForm
117abs ( const CanonicalForm & f )
118{
119 // it is not only more general to use `sign()' instead of a
120 // direct comparison `f < 0', it is faster, too
121 if ( sign( f ) < 0 )
122 return -f;
123 else
124 return f;
125}
126//}}}
127
128/*ENDPUBLIC*/

Callers 15

choosePointFunction · 0.70
absBiFactorizeMainFunction · 0.70
terminationTestFunction · 0.70
modGCDZFunction · 0.70
icontentFunction · 0.70
gcd_poly_pFunction · 0.70
cf_contentFunction · 0.70
contentFunction · 0.70
gcdFunction · 0.70
oneNormFunction · 0.70
alg_contentFunction · 0.70
subResGCD_pFunction · 0.70

Calls 1

signFunction · 0.70

Tested by

no test coverage detected