Generic Functions
- gmpy2.add(x, y, /)
Return x + y.
- gmpy2.div(x, y, /)
Return x / y; uses true division.
- gmpy2.mul(x, y, /)
Return x * y.
- gmpy2.sub(x, y, /)
Return x - y.
- gmpy2.square(x, /)
Return x * x.
- gmpy2.f2q(x, err=0, /)
Return the ‘best’
mpqapproximating x to within relative error err. Default is the precision of x. Uses Stern-Brocot tree to find the ‘best’ approximation. Anmpzobject is returned if the denominator is 1. If err<0, relative error is 2.0 ** err.
- gmpy2.fma(x, y, z, /)
Return correctly rounded result of (x * y) + z.
- gmpy2.fms(x, y, z, /)
Return correctly rounded result of (x * y) - z.
- gmpy2.cmp_abs(x, y, /)
Return -1 if abs(x) < abs(y); 0 if abs(x) = abs(y); or 1 else.