CRE Programmer's Guide

Math Functions
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
7-9
Log10
e is the natural logarithm base, approximately 2.718281828459045.
Considerations
An arithmetic fault occurs if number is less than or equal to 0.
Examples
REAL(32) r1, r2, r3;
r1 := CRE_Ln_Real32_( 7.389056096 ); ! r1 is approx 2.
r2 := CRE_Ln_Real32_( 20.08553691 ); ! r2 is approx 3.
r3 := CRE_Ln_Real32_( 54.59814999 ); ! r3 is approx 4.
The values returned in R1, R2, and R3 derive from the following:
ln(7.389056096)
2. That is, e
2
7.389056096
ln(20.08553691)
3. That is, e
3
20.08553691
ln(54.59814999)
4. That is, e
4
54.59814999
Log10
The Log10 functions return a common—that is, base 10—logarithm.
number
is the number whose common logarithm is returned.
Return Value
The Log10 functions return “exponent,” where exponent satisfies the equation:
10
exponent
= number
Considerations
An arithmetic fault occurs if number is less than or equal to 0.
Examples
REAL(32) r1, r2, r3;
r1 := CRE_Log10_Real32_(100); ! r1 is approx 2.
r2 := CRE_Log10_Real32_(1000); ! r2 is approx 3.
r3 := CRE_Log10_Real32_(10000); ! r3 is approx 4.
REAL(32) PROC { CRE_Log10_Real32_ } ( number );
{ RTL_Log10_Real32_ }
REAL(32) number; ! in TNS only
REAL(64) PROC { CRE_Log10_Real64_ } ( number );
{ RTL_Log10_Real64_ }
REAL(64) number; ! in TNS only