December 2005
Beginner to intermediate
618 pages
20h 19m
English
ldexp
Multiplies a floating-point number by a power of two
#include <math.h> doubleldexp( doublemantissa, intexponent); floatldexpf( floatmantissa, intexponent); (C99) long doubleldexpl( long doublemantissa, intexponent); (C99)
The ldexp() functions
calculate a floating-point number from separate mantissa and
exponent values. The exponent parameter
is an integer exponent to base 2.
The function returns the value
mantissa ×
2exponent. If the result is not
representable in the function’s type, a range error may
occur.
See the example for frexp() in this
chapter.
The function frexp(), which performs
the reverse operation, analyzing a floating-point number into a
mantissa and an exponent to base 2.
Read now
Unlock full access