Floating-Point Intrinsic Functions
The floating-point intrinsic functions can be separated into a group of general-purpose functions and three groups of related transcendental functions. Except for _isunordered, these functions have always been part of the Microsoft C Run-Time Library for Windows CE, and the intrinsic versions perform the same operation as the run-time versions except as noted. For more information, see Microsoft C Run-Time Library for Windows CE .NET.
All floating-point operations should adhere to the IEEE Standard for Binary Floating-Point Arithmetic, or IEEE-754. The IEEE standard reserves some exponent fields for special values. These special values include zero and the value NaN, Not a Number. NaN represents a value that is not a real number, such as the indeterminate result of dividing a real number by zero.
The floating-point intrinsic functions are available in both double-precision and single-precision versions, and you can implement them as single instructions on some platforms. The following table shows the general-purpose floating-point intrinsic functions.
Operation | Description |
---|---|
fabs fabsf |
Calculates the absolute value of a floating-point number. |
floor floorf |
Calculates the floor (greatest integer less than or equal to) value of a number. |
ceil ceilf |
Calculates the ceiling (smallest integer greater than or equal to) value of a number. This is the result of rounding up. |
fmod fmodf |
Calculates the modulus, or floating-point remainder. |
sqrt sqrtf |
Calculates the square root of a floating-point number. |
_isnan
_isnanf |
Determines a Boolean value, true when argument is not a number (NaN). Returns false when argument is zero, subnormal, or infinite. |
_isunordered | Determines a Boolean value, returns true when arguments are unordered. This function is not part of the Microsoft C Run-Time Library for Windows CE .NET. |
In addition to general-purpose floating-point intrinsic functions, Windows CE .NET provides support for transcendental floating-point functions. These intrinsic functions implement logarithmic, trigonometric, and hyperbolic functions. The transcendental intrinsic functions take double-precision arguments and return a double-precision result. These functions have always been available as intrinsic on all platforms and are provided for backwards compatibility. In most cases they are implemented by calling the Microsoft C Run-Time Library.
The following table shows the logarithmic functions.
Intrinsic function | Description |
---|---|
exp | Calculates the exponential function value of a floating-point number. |
log | Calculates the natural logarithm (base e) of a floating-point number. |
log10 | Calculates the common logarithm (base 10) of a floating-point number. |
pow | Calculates the value of x raised to the power of y, x^y. |
The following table shows the trigonometric functions.
Intrinsic function | Description |
---|---|
cos | Calculates the cosine of a floating-point number from a radian argument. |
sin | Calculates the sine of a floating-point number from a radian argument. |
tan | Calculates the tangent of a floating-point number from a radian argument. |
acos | Calculates the arccosine of a floating-point number, in radians. |
asin | Calculates the arcsine of a floating-point number, in radians. |
atan | Calculates the arctangent of a floating-point number, in radians. |
atan2 | Calculates the arctangent of a floating-point number y/x as a rational number. |
The following table shows the hyperbolic functions.
Intrinsic function | Description |
---|---|
sinh | Calculates the hyperbolic cosine of a floating-point number. |
cosh | Calculates the hyperbolic sine of a floating-point number. |
tanh | Calculates the hyperbolic tangent of a floating-point number. |
See Also
Common Intrinsic Functions | Integer Intrinsic Functions | Floating-Point Intrinsic Functions | String and Block Intrinsic Functions | System Intrinsic Functions | Microprocessor-specific Intrinsic Functions
Last updated on Thursday, April 08, 2004
© 1992-2003 Microsoft Corporation. All rights reserved.