![]() |
C - Entwicklung Mathematik: Logarithmus, Exponent Homepage von PS-Trainer - C-Entwicklung - Mathematik - an PS-Trainer |
|
| Math and related | Logarithm and Exponent |
| exp | Calculate the exponential. |
| log | Calculate logarithms. |
| ldexp
|
Compute a real number from the mantissa and exponent. |
| frexp
|
Get the mantissa and exponent of a floating-point number. |
| exp Calculates the exponential. double exp( double x );
Subject: Floating-Point Support Routines Keywords: See also log |
||||||
| Return Value The exp function returns the exponential value of the floating-point parameter, x, if successful. On overflow, the function returns INF (infinite) and on underflow, exp returns 0. Parameter
|
||||||
| Example /* EXP.C */ #include <math.h> void main( void ) y = exp( x ); |
| log, log10 Calculates logarithms. double log( double x ); double log10( double x );
Subject: Floating-Point Support Routines Keywords: See Also exp, _matherr, pow |
|||||||||
| Return Value The log functions return the logarithm of x if successful. If x is negative, these functions return an indefinite (same as a quiet NaN). If x is 0, they return INF (infinite). You can modify error handling by using the _matherr routine. Parameter
|
|||||||||
|
Example #include <math.h> void main( void ) y = log( x ); |
| ldexp Computes a real number from the mantissa and exponent. double ldexp( double x, int exp );
Subject: Floating-Point Support Keywords: See also frexp, modf |
||||||
| Return Value The ldexp function returns the value of x * 2exp if successful. On overflow (depending on the sign of x), ldexp returns +/ HUGE_VAL; the errno variable is set to ERANGE. Parameters
|
||||||
|
Example #include <math.h> void main( void ) y = ldexp( x, p ); |
| frexp Gets the mantissa and exponent of a floating-point number. double frexp( double x, int *expptr );
Remarks The frexp function breaks down the floating-point value (x) into a mantissa (m) and an exponent (n), such that the absolute value of m is greater than or equal to 0.5 and less than 1.0, and x = m*2n. The integer exponent n is stored at the location pointed to by expptr. Subject: Floating-Point Support Routines Keywords: See also ldexp, modf |
||||||
| Return Value frexp returns the mantissa. If x is 0, the function returns 0 for both the mantissa and the exponent. There is no error return. Parameters
|
||||||
| Example /* FREXP.C: This program calculates frexp( 16.4, &n ) * then displays y and n. */ #include <math.h> void main( void ) x = 16.4; |
| Aktuelle Daten dieser Seite | Letzte Änderung: |
| |