Next: Extra Signed Integer Functions, Up: Extra Number Functions [Index]
Set the value of the rational number Q to
0
, +1
, -1
, 0/0
(NaN),
+1/0
(+infinity) and -1/0
(-infinity), respectively.
These utility functions are implemented as plain macros (with self-explanatory names).
Return 1
(read true)
if the rational number Q
is either zero, nonzero, positive, negative, strictly positive or strictly negative,
respectively,
0
(read false)
otherwise.
These test functions are plain macro functions (with self-explanatory names).
Return 1
(read true)
if the rational number op is Not-a-Number,
0
(read false)
otherwise.
NaN, the acronym for Not-a-Number, has the representation 0/0.4
Return +1
if the rational number op is positive infinity,
-1
if it is negative infinity,
0
otherwise.
Positive and negative infinities have the representation +1/0 and -1/0, respectively;5 they are commonly written +infinity and -infinity, respectively.
Return 1
(read true)
if the rational number op is finite,
0
(read false)
if it is either infinite or Not-a-Number.
Return +1
if the rational op is strictly positive,
0
if it is zero,
or -1
if it is strictly negative.
Its behaviour stays undefined if its argument is NaN (0/0).
While its counterpart mpq_sgn
is implemented as a macro,
this function is implemented as an inline function:
it evaluates its argument only once.
Compare the absolute values of the rational numbers op1 and op2. Return either a positive value if abs(op1) is strictly greater than abs(op2), zero if abs(op1) is equal to abs(op2), or a negative value if abs(op1) is strictly smaller than abs(op2). Its behaviour remains undefined if at least one of its arguments is either -infinity (-1/0), +infinity (+1/0), or NaN (0/0).
Set the value of rop to the minimum of the triplet {op1,op2,op3}. Its behaviour is undefined if the triplet contains -infinity (-1/0), +infinity (+1/0), or NaN (0/0).
At the time of writing, GMP does not support NaN for mpq_t
numbers.
At the time of writing, GMP does not support infinities for mpq_t
numbers.
Next: Extra Signed Integer Functions, Up: Extra Number Functions [Index]