home *** CD-ROM | disk | FTP | other *** search
- /*********
- * EXPONENT.C
- *
- * by Ralph Davis
- * modified by Tom Rettig
- *
- * Placed in the public domain by Tom Rettig Associates, 10/22/1990.
- *
- * Syntax: EXPONENT( <expN> )
- * Return: Power of 2 used to represent <expN> in memory
- *********/
-
- #include "trlib.h"
-
- TRTYPE exponent()
- {
- if ( PCOUNT==1 && ISNUM(1) )
- {
- int expon = 0;
- double result, n;
-
- n = _parnd(1);
- result = _tr_frexp(n,&expon); /* Returns exponent in expon */
- _retni(expon);
- }
- else
- _retni( ERROR );
- }
-