strtof


Conversion of character string to flonptrating-point number (float type) and storing pointer to last character string

[Classification]

Standard library

[Syntax]

#include <stdlib.h>

float __far strtof(const char __near *nptr, char __near * __near *endptr); (C90)

float __far strtof(const char __near * restrict nptr, char __near * __near * restrict endptr); (C99) [V1.07 or later]

float __far _COM_strtof_ff(const char __far *nptr, char __far * __far *endptr); (C90)

float __far _COM_strtof_ff(const char __far * restrict nptr, char __far * __far * restrict endptr); (C99) [V1.07 or later]

[Return value]

If the partial character string has been converted, the resultant value is returned. If the character string could not be converted, 0 is returned.

If an overflow occurs, strtof returns ±∞ and sets macro ERANGE to global variable errno.

If an underflow occurs, strtof returns 0 and sets macro ERANGE to global variable errno.

[Description]

This function skips 0 or more columns of white-space characters (character which makes the isspace function true) from the start of the string indicated by nptr, and converts the string from the next character into a float-type representation. When endptr is not the null pointer, the pointer to the remaining strings that were not converted is set to endptr.

[Restrictions]

Hexadecimal floating-point numbers are not supported in a recognizable format of a string that is subject to the conversion method specified in the C99 standard.