User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cl:functions:numerator [2019/06/15 02:00]
cl:functions:numerator [2019/06/16 07:00] (current)
Line 1: Line 1:
 +====== Function NUMERATOR, DENOMINATOR ======
 +
 +====Syntax====
 +  * **numerator ** //​rational//​ → //​numerator// ​
 +  * **denominator** //​rational//​ → //​denominator//​
 +
 +====Arguments and Values====
 +  * //​rational//​ - a //​[[CL:​Glossary:​rational]]//​.
 +  * //​numerator//​ - an //​[[CL:​Glossary:​integer]]//​.
 +  * //​denominator//​ - a positive //​[[CL:​Glossary:​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 //​[[CL:​Glossary:​integer]]//,​ **numerator** returns //​rational//​ and **denominator** returns 1.
 +
 +====Examples==== ​
 +<​blockquote> ​
 +(numerator 1/2) <r>1 </r>
 +(denominator 12/36) <r>3 </r>
 +(numerator -1) <r>-1 </r>
 +(denominator ([[CL:​Functions:​math-divide|/​]] -33)) <r>33 </r>
 +(numerator ([[CL:​Functions:​math-divide|/​]] 8 -6)) <r>-4 </r>
 +(denominator ([[CL:​Functions:​math-divide|/​]] 8 -6)) <r>3 </r>
 +</​blockquote>​
 +
 +====Side Effects====
 +None.
 +
 +====Affected By====
 +None.
 +
 +====Exceptional Situations====
 +None.
 +
 +====See Also====
 +  * **[[CL:​Functions:​math-divide|Function /]]**
 +
 +====Notes==== ​
 +<​blockquote> ​
 +(gcd (numerator x) (denominator x)) <r>1 </r>
 +</​blockquote>​
 +