blob: c3894124e16e1238d1ac2805d0387508fc771a5d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
.TH FMTSTRTOD 3
.SH NAME
fmtstrtod, fmtcharstod \ - convert text to numbers
.SH SYNOPSIS
.B #include <utf.h>
.br
.B #include <fmt.h>
.PP
.PP
.B
double fmtstrtod(char *nptr, char **rptr)
.PP
.B
double fmtcharstod(int (*f)(void *), void *a)
.SH DESCRIPTION
.I Fmtstrtod
converts a string pointed to by
.I nptr
to floating point representation and, if
.I rptr
is not zero, sets
.I *rptr
to point to the input character immediately after the string converted.
.I Fmtstrtod
recognizes an optional string of tabs and spaces,
then an optional sign, then a string of digits optionally
containing a decimal point, then an optional
.L e
or
.L E
followed by an optionally signed integer.
.PP
.PP
.I Fmtcharstod
interprets floating point numbers in the manner of
.IR atof ,
but gets successive characters by calling
.BR (*\fIf\fP)(a) .
The last call to
.I f
terminates the scan, so it must have returned a character that
is not a legal continuation of a number.
Therefore, it may be necessary to back up the input stream one character
after calling
.IR fmtcharstod .
.SH SOURCE
.B https://9fans.github.io/plan9port/unix
.SH SEE ALSO
.IR fscanf (3)
.SH DIAGNOSTICS
Zero is returned if the beginning of the input string is not interpretable
as a number; even in this case,
.I rptr
will be updated.
|