VMS Help  —  CRTL  atof
    Converts an ASCII character string to a double-precision number.

    Format

      #include  <stdlib.h>

      double atof  (const char *nptr);

1  –  Argument

 nptr

    A pointer to the character string to be converted to a double-
    precision number. The string is interpreted by the same rules
    that are used to interpret floating constants.

2  –  Description

    The string to be converted has the following format:

    [white-spaces][+|-]digits[radix-character][digits][e|E[+|-]integer]

    Where radix-character is defined in the current locale.

    The first unrecognized character ends the conversion.

    This function is equivalent to strtod(nptr, (char**) NULL).

3  –  Return Values

    x                  The converted value.
    0                  Indicates an underflow or the conversion could
                       not be performed. The function sets errno to
                       ERANGE or EINVAL, respectively.
    HUGE_VAL           Overflow occurred; errno is set to ERANGE.
Close Help