Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1906 | serge | 1 | /* |
2 | FUNCTION |
||
3 | < |
||
4 | |||
5 | INDEX |
||
6 | atof |
||
7 | INDEX |
||
8 | atoff |
||
9 | |||
10 | ANSI_SYNOPSIS |
||
11 | #include |
||
12 | double atof(const char *<[s]>); |
||
13 | float atoff(const char *<[s]>); |
||
14 | |||
15 | TRAD_SYNOPSIS |
||
16 | #include |
||
17 | double atof(<[s]>) |
||
18 | char *<[s]>; |
||
19 | |||
20 | float atoff(<[s]>) |
||
21 | char *<[s]>; |
||
22 | |||
23 | DESCRIPTION |
||
24 | < |
||
25 | < |
||
26 | |||
27 | The functions parse the character string <[s]>, |
||
28 | locating a substring which can be converted to a floating-point |
||
29 | value. The substring must match the format: |
||
30 | . [+|-]<[digits]>[.][<[digits]>][(e|E)[+|-]<[digits]>] |
||
31 | The substring converted is the longest initial |
||
32 | fragment of <[s]> that has the expected format, beginning with |
||
33 | the first non-whitespace character. The substring |
||
34 | is empty if < |
||
35 | of whitespace, or if the first non-whitespace character is |
||
36 | something other than <<+>>, <<->>, <<.>>, or a digit. |
||
37 | |||
38 | < |
||
39 | < |
||
40 | |||
41 | RETURNS |
||
42 | < |
||
43 | < |
||
44 | If the correct value is out of the range of representable values, plus |
||
45 | or minus < |
||
46 | < |
||
47 | If the correct value would cause underflow, <<0.0>> is returned |
||
48 | and < |
||
49 | |||
50 | < |
||
51 | returns a < |
||
52 | |||
53 | PORTABILITY |
||
54 | < |
||
55 | and < |
||
56 | less reliable, but may be faster if the argument is verified to be in a valid |
||
57 | range. |
||
58 | |||
59 | Supporting OS subroutines required: < |
||
60 | < |
||
61 | */ |
||
62 | |||
63 | |||
64 | #include |
||
65 | #include <_ansi.h> |
||
66 | |||
67 | double |
||
68 | _DEFUN (atof, (s), |
||
69 | _CONST char *s) |
||
70 | { |
||
71 | return strtod (s, NULL); |
||
72 | } |