mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
40 lines
587 B
Plaintext
40 lines
587 B
Plaintext
NAME
|
|
den - denominator of a real number
|
|
|
|
SYNOPSIS
|
|
den(x)
|
|
|
|
TYPES
|
|
x real
|
|
|
|
return integer
|
|
|
|
DESCRIPTION
|
|
For real x, den(x) returns the denominator of x when x is expressed
|
|
in lowest terms with positive denominator. 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
|
|
|
|
The denominator for this n/d is d.
|
|
|
|
EXAMPLE
|
|
> print den(7), den(-1.25), den(121/33)
|
|
1 4 3
|
|
|
|
LIMITS
|
|
none
|
|
|
|
LIBRARY
|
|
NUMBER *qden(NUMBER *x)
|
|
|
|
SEE ALSO
|
|
num
|