| 1 | ATOF(3) BSD Programmer's Manual ATOF(3) |
| 2 | |
| 3 | N\bNA\bAM\bME\bE |
| 4 | a\bat\bto\bof\bf - convert ASCII string to double |
| 5 | |
| 6 | S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS |
| 7 | #\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<s\bst\btd\bdl\bli\bib\bb.\b.h\bh>\b> |
| 8 | |
| 9 | _\bd_\bo_\bu_\bb_\bl_\be |
| 10 | a\bat\bto\bof\bf(_\bc_\bo_\bn_\bs_\bt _\bc_\bh_\ba_\br _\b*_\bn_\bp_\bt_\br); |
| 11 | |
| 12 | D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN |
| 13 | The a\bat\bto\bof\bf() function converts the initial portion of the string pointed to |
| 14 | by _\bn_\bp_\bt_\br to _\bd_\bo_\bu_\bb_\bl_\be representation. |
| 15 | |
| 16 | It is equivalent to: |
| 17 | |
| 18 | strtod(nptr, (char **)NULL); |
| 19 | |
| 20 | S\bSE\bEE\bE A\bAL\bLS\bSO\bO |
| 21 | atoi(3), atol(3), strtod(3), strtol(3), strtoul(3) |
| 22 | |
| 23 | S\bST\bTA\bAN\bND\bDA\bAR\bRD\bDS\bS |
| 24 | The a\bat\bto\bof\bf() function conforms to ANSI C X3.159-1989 (``ANSI C ''). |
| 25 | |
| 26 | B\bBU\bUG\bGS\bS |
| 27 | This manual page represents intent instead of actual practice. While it |
| 28 | is intended that a\bat\bto\bof\bf() be implemented using strtod(3), this has not yet |
| 29 | happened. In the current system, a\bat\bto\bof\bf() translates a string in the fol- |
| 30 | lowing form to a double: a string of leading white space, possibly fol- |
| 31 | lowed by a sign (``+'' or ``-''), followed by a digit string which may |
| 32 | contain one decimal point (``.''), which may be followed by either of the |
| 33 | exponent flags (``E'' or ``e''), and lastly, followed by a signed or un- |
| 34 | signed integer. |
| 35 | |
| 36 | 4.4BSD June 4, 1993 1 |