Rev | Line | |
---|
[9] | 1 | .\" @(#)atof.3 6.1 (Berkeley) 5/15/85
|
---|
| 2 | .\"
|
---|
| 3 | .TH ATOF 3 "May 15, 1985"
|
---|
| 4 | .AT 3
|
---|
| 5 | .SH NAME
|
---|
| 6 | atof, atoi, atol \- convert ASCII to numbers
|
---|
| 7 | .SH SYNOPSIS
|
---|
| 8 | .nf
|
---|
| 9 | .ft B
|
---|
| 10 | #include <stdlib.h>
|
---|
| 11 |
|
---|
| 12 | double atof(const char *\fInptr\fP)
|
---|
| 13 | int atoi(const char *\fInptr\fP)
|
---|
| 14 | long atol(const char *\fInptr\fP)
|
---|
| 15 | .ft R
|
---|
| 16 | .fi
|
---|
| 17 | .SH DESCRIPTION
|
---|
| 18 | These functions convert a string pointed to by
|
---|
| 19 | .I nptr
|
---|
| 20 | to floating, integer, and long integer representation respectively.
|
---|
| 21 | The first unrecognized character ends the string.
|
---|
| 22 | .PP
|
---|
| 23 | .B Atof
|
---|
| 24 | recognizes an optional string of spaces, then an optional sign, then
|
---|
| 25 | a string of digits optionally containing a decimal
|
---|
| 26 | point, then an optional `e' or `E' followed by an optionally signed integer.
|
---|
| 27 | .PP
|
---|
| 28 | .B Atoi
|
---|
| 29 | and
|
---|
| 30 | .B atol
|
---|
| 31 | recognize an optional string of spaces, then an optional sign, then a
|
---|
| 32 | string of
|
---|
| 33 | digits.
|
---|
| 34 | .SH SEE ALSO
|
---|
| 35 | .BR strtol (3),
|
---|
| 36 | .BR strtod (3),
|
---|
| 37 | .BR scanf (3).
|
---|
| 38 | .SH BUGS
|
---|
| 39 | There are no provisions for overflow.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.