atof

Converts a character string to a floating-point number

double atof (
        const char *s
)

Arguments

s Pointer to a character string

Return Value

The result of converting the input string pointed to by s to a double-precision value is returned. If the value exceeds the range that can be expressed, either +HUGE_VAL(1.797693134862316e+308) or -HUGE_VAL is returned according to the sign. 0 is returned if an underflow occurs.

Explanation

The character string pointed to by s which represents a floating point number, is converted to a double-precision floating point value.

Notes

Error processing is shown in the following table:
 
Condition Return value Error
Outside the range that can be expressed +/- HUGE_VAL Domain error
Underflow 0 Domain error

See Also

strtod()