3 <<atof>>, <<atoff>>---string to double or float
12 double atof(const char *<[s]>);
13 float atoff(const char *<[s]>);
16 <<atof>> converts the initial portion of a string to a <<double>>.
17 <<atoff>> converts the initial portion of a string to a <<float>>.
19 The functions parse the character string <[s]>,
20 locating a substring which can be converted to a floating-point
21 value. The substring must match the format:
22 . [+|-]<[digits]>[.][<[digits]>][(e|E)[+|-]<[digits]>]
23 The substring converted is the longest initial
24 fragment of <[s]> that has the expected format, beginning with
25 the first non-whitespace character. The substring
26 is empty if <<str>> is empty, consists entirely
27 of whitespace, or if the first non-whitespace character is
28 something other than <<+>>, <<->>, <<.>>, or a digit.
30 <<atof(<[s]>)>> is implemented as <<strtod(<[s]>, NULL)>>.
31 <<atoff(<[s]>)>> is implemented as <<strtof(<[s]>, NULL)>>.
34 <<atof>> returns the converted substring value, if any, as a
35 <<double>>; or <<0.0>>, if no conversion could be performed.
36 If the correct value is out of the range of representable values, plus
37 or minus <<HUGE_VAL>> is returned, and <<ERANGE>> is stored in
39 If the correct value would cause underflow, <<0.0>> is returned
40 and <<ERANGE>> is stored in <<errno>>.
42 <<atoff>> obeys the same rules as <<atof>>, except that it
46 <<atof>> is ANSI C. <<atof>>, <<atoi>>, and <<atol>> are subsumed by <<strod>>
47 and <<strol>>, but are used extensively in existing code. These functions are
48 less reliable, but may be faster if the argument is verified to be in a valid
51 Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
52 <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
62 return strtod (s
, NULL
);