mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
39 lines
517 B
Plaintext
39 lines
517 B
Plaintext
NAME
|
|
num - numerator of a real number
|
|
|
|
SYNOPSIS
|
|
num(x)
|
|
|
|
TYPES
|
|
x real
|
|
|
|
return integer
|
|
|
|
DESCRIPTION
|
|
For real x, den(x) returns the denominator of x. In calc,
|
|
real values are actually rational values. Each calc real
|
|
value can be uniquely expressed as:
|
|
|
|
n / d
|
|
|
|
where:
|
|
|
|
n and d are integers
|
|
gcd(n,d) == 1
|
|
d > 0
|
|
|
|
If x = n/x, then den(x) == n.
|
|
|
|
EXAMPLE
|
|
> print num(7), num(-1.25), num(121/33)
|
|
7 -5 11
|
|
|
|
LIMITS
|
|
none
|
|
|
|
LIBRARY
|
|
NUMBER *qnum(NUMBER *x)
|
|
|
|
SEE ALSO
|
|
den
|