
numerator(+Number, -Result)
-Result is numerator(+Number)

   Extracts the numerator of the rational Number and unifies the resulting
integer with Result.



Arguments
   Number              An integer or rational number.
   Result              Output: integer.

Type
   Arithmetic

Description

   Extracts the numerator of the rational Number and unifies the resulting
   integer with Result.

   This predicate can be used as a function in arithmetic expressions.
   In coroutining mode, if Number is uninstantiated, the call to
   numerator/2 is delayed until this variable is instantiated.




Modes and Determinism
   numerator(+, -) is det

Exceptions
     4 --- Number is not instantiated (non-coroutining mode only).
     5 --- Number is a float or breal.
    24 --- Number is not of a numeric type.

Examples
   
Success:
    Result is numerator(3_4).		% gives Result = 3
    Result is numerator(9_12).		% gives Result = 3
    Result is numerator(-3_4).		% gives Result = -3
    Result is numerator(25).		% gives Result = 25

Error:
    Result is numerator(3.1).           % type error


See Also
   is / 2, denominator / 2, rational / 2
