English
Language : 

CC78K0S Datasheet, PDF (262/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 10 LIBRARY FUNCTIONS
7-13 ldexp (normal model only)
Mathematical Functions
FUNCTION
ldexp finds x*2^exp.
HEADER
math.h
FUNCTION PROTOTYPE
double ldexp (double x, int exp) ;
Function
exp
Arguments
x ... Numeric value on which
operation is performed
exp ... Exponent
Return Value
Normal ... x*2 ^ exp
When x = NaN ... NaN
When x = ±∞ ... ±∞
When x = ±0 ... ±0
When overflow occurs ...
HUGE_VAL (with the sign of
the overflown value)
When underflow occurs ...
Non-normalized number
When annihilation of valid
digits occurs due to underflow
... ±0
EXPLANATION
• Calculates x*2^exp.
• If x is non-numeric, NaN is returned.
• If x is ±∞, ±∞ is returned.
• If x is ±0, ±0 is returned.
• If an overflow occurs as a result of the operation, HUGE_VAL with the overflowed value is returned and
ERANGE is set to errno.
• If an underflow occurs as a result of the operation, a non-normalized number is returned.
• If annihilation of valid digits due to underflow occurs as a result of the operation, ±0 is returned.
262
User’s Manual U14872EJ1V0UM