Floating-Point Support (Windows Embedded CE 6.0)

1/5/2010

Many Microsoft run-time library functions require floating-point support from a math coprocessor or from the floating-point libraries that accompany the compiler. Floating-point support functions are loaded only if required.

When you use a floating-point type specifier in the format string of a call to a function in the printf or scanf family, you must specify a floating-point value or a pointer to a floating-point value in the argument list to tell the compiler that floating-point support is required.

The math functions in the Microsoft run-time library handle exceptions the same way that UNIX V math functions do.

The Microsoft run-time library sets the default internal precision of the math coprocessor (or emulator) to 64 bits. This default applies only to the internal precision at which all intermediate calculations are performed; it does not apply to the size of arguments, return values, or variables.

You can override this default and set the chip (or emulator) back to 80-bit precision by linking your program with LIB/FP10.OBJ.

On the linker command line, FP10.OBJ must appear before LIBC.LIB, LIBCMT.LIB, or MSVCRT.LIB.

For detailed reference information about the CRT functions, see Alphabetical Function Reference (CRT).

Routine Use

abs

Returns absolute value of int

acos

Calculates arccosine

asin

Calculates arcsine

atan, atan2

Calculates arctangent

atof

Converts character string to double-precision floating-point value

_cabs

Finds absolute value of complex number

ceil, ceilf

Finds integer ceiling

_chgsign

Reverses sign of double-precision floating-point argument

clearerr

Clears error.

This function has been deprecated because a more secure version, clearerr_s, is available.

clearerr_s

Resets the error indicator for a stream.

Security-enhanced version of clearerr.

_controlfp

Gets and sets the floating-point control word.

This function has been deprecated because a more secure version, _controlfp_s, is available.

controlfp_s

Gets and sets the floating-point control word.

Security-enhanced version of deprecated function _controlfp. Returns error for bad parameters.

_copysign

Returns one value with sign of another

cos

Calculates cosine

cosh

Calculates hyperbolic cosine

div

Divides one integer by another, returning quotient and remainder

_ecvt

Converts double to character string of specified length.

This function has been deprecated because a more secure version, _evct_s, is available.

_ecvt_s

Converts a double number to a string.

Security-enhanced version of deprecated function _ecvt. Validates parameters and sets errno. Template overload available.

exp

Calculates exponential function

fabs, fabsf

Finds absolute value

_fcvt

Converts double to string with specified number of digits following decimal point.

This function has been deprecated because a more secure version, _fvct_s, is available.

_fcvt_s

Converts a floating-point number to a string.

Security-enhanced version of deprecated function _fcvt. Validates parameters and sets errno. Template overload available.

_finite

Determines whether given double-precision floating-point value is finite

floor, floorf

Finds largest integer less than or equal to argument

fmod, fmodf

Finds floating-point remainder

_fpclass

Returns status word containing information on floating-point class

_fpieee_flt

Invokes user-defined trap handler for IEEE floating-point exceptions

_fpreset

Reinitializes floating-point math package

frexp

Calculates exponential value

_gcvt

Converts floating-point value to character string.

This function has been deprecated because a more secure version, _gvct_s, is available.

_gcvt_s

Converts a floating-point value to a string.

Security-enhanced version of deprecated function _gcvt. Validates parameters and sets errno. Template overload available.

_hypot

Calculates hypotenuse of right triangle

_isnan

Checks given double-precision floating-point value for not a number (NaN)

_j0, _j1, _jn

Calculates Bessel functions _j0, _j1, and _jn

labs

Returns absolute value of long

ldexp

Calculates product of argument and 2 to specified power

ldiv

Divides one long integer by another, returning quotient and remainder

log, log10

Calculates logarithm

_logb

Extracts exponential value of double-precision floating-point argument

_lrotl, _lrotr

Shifts unsigned long int left (_lrotl) or right (_lrotr)

modf

Splits argument into integer and fractional parts

_nextafter

Returns next representable neighbor

pow

Calculates value raised to a power

rand

Gets pseudorandom number

rand_s

Generates a pseudorandom number.

Security-enhanced version of rand.

_rotl, _rotr

Shifts unsigned int left (_rotl) or right (_rotr)

_scalb

Scales argument by power of 2

sin

Calculates sine

sinh

Calculates hyperbolic sine

sqrt

Finds square root

srand

Initializes pseudorandom series

_statusfp

Gets floating-point status word

strtod

Converts character string to double-precision value

tan

Calculates tangent

tanh

Calculates hyperbolic tangent

_y0, _y1, _yn

Calculates Bessel functions _yo, _y1, and _yn

See Also

Concepts

Run-Time Routines by Category

Other Resources

C/C++ Libraries for Windows Embedded CE
What's New in the C Run-Time Library