[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


strtold

Character array conversion to floating point value of type long double.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <stdlib.h>
long double strtold( const char *nptr, 
  char **endptr);
Parameters:

Parameters for this facility are:

nptr  
const char *  
A Null terminated array to convert  
endptr  
char **  
A pointer to a position in nptr that follows the converted part  

Remarks:

The strtold() function converts a character array, pointed to by nptr, to a floating point value of type long double. The character array can be in either decimal or hexadecimal floating point constant notation (e.g. 103.578, 1.03578e+02, or 0x1.9efef9p+6).

If the endptr argument is not a null pointer, it is assigned a pointer to a position within the character array pointed to by nptr. This position marks the first character that is not convertible to a value of type double.

This function skips leading white space.

This function sets the global variable errno to ERANGE if there is a conversion error.

Return:

strtold() returns a floating point value of type long double. If nptr cannot be converted to an expressible double value, strtold() returns HUGE_VAL, defined in math.h, and sets errno to ERANGE.

See Also:

"strtol"

"errno"

"Overview of math.h"

For example of strtold() usage:
Refer to "Example of strtod() and strtold() usage.".


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000