ToC DocOverview CGDoc RelNotes Index PermutedIndex
Allegro CL
Home Previous Up Next Table of Contents Index
  ANSI Common Lisp   12 Numbers   12.2 Dictionary of Numbers

12.2.53 numerator, denominator Function

Syntax:
numerator rational    numerator

denominator rational    denominator

Arguments and Values:
rational - a rational.

numerator - an integer.

denominator - a positive integer.

Description:
numerator and denominator reduce rational to canonical form and compute the numerator or denominator of that number.

numerator and denominator return the numerator or denominator of the canonical form of rational.

If rational is an integer, numerator returns rational and denominator returns 1.

Examples:
 (numerator 1/2)  1
 (denominator 12/36)  3
 (numerator -1)  -1
 (denominator (/ -33))  33
 (numerator (/ 8 -6))  -4
 (denominator (/ 8 -6))  3

See Also:
/

Notes:
 (gcd (numerator x) (denominator x))  1

Allegro CL Implementation Details:
None.

Home Previous Up Next Table of Contents Index
© Franz Inc. 1998-2015 - File last updated 03-23-2015