Next Previous Contents

18. atof

Synopsis

Convert a string to a double precision number

Usage

Double_Type atof (String_Type s)

Description

This function converts a string s to a double precision value and returns the result. It performs no error checking on the format of the string. The function _slang_guess_type may be used to check the syntax of the string.

Example

     define error_checked_atof (s)
     {
        switch (_slang_guess_type (s))
        {
           case Double_Type:
             return atof (s);
        }
        {
           case Integer_Type:
             return double (integer (s));
        }

        verror ("%s is is not a double", s);
    }
See Also

typecast, double, _slang_guess_type


Next Previous Contents