summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/strtod.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/stdlib/strtod.3')
-rw-r--r--src/lib/libc/stdlib/strtod.337
1 files changed, 20 insertions, 17 deletions
diff --git a/src/lib/libc/stdlib/strtod.3 b/src/lib/libc/stdlib/strtod.3
index 0b7f973857..4e04f6738e 100644
--- a/src/lib/libc/stdlib/strtod.3
+++ b/src/lib/libc/stdlib/strtod.3
@@ -33,8 +33,7 @@
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE. 34.\" SUCH DAMAGE.
35.\" 35.\"
36.\" from: @(#)strtod.3 5.3 (Berkeley) 6/29/91 36.\" $OpenBSD: strtod.3,v 1.7 2000/04/20 13:50:03 aaron Exp $
37.\" $Id: strtod.3,v 1.1.1.1 1995/10/18 08:42:19 deraadt Exp $
38.\" 37.\"
39.Dd June 29, 1991 38.Dd June 29, 1991
40.Dt STRTOD 3 39.Dt STRTOD 3
@@ -51,20 +50,25 @@ string to double
51.Sh DESCRIPTION 50.Sh DESCRIPTION
52The 51The
53.Fn strtod 52.Fn strtod
54function converts the initial portion of the string 53function converts the initial portion of the string pointed to by
55pointed to by
56.Fa nptr 54.Fa nptr
57to 55to
58.Em double 56.Li double
59representation. 57representation.
60.Pp 58.Pp
61The expected form of the string is an optional plus (``+'') or minus 59The expected form of the string is an optional plus
62sign (``-'') followed by a sequence of digits optionally containing 60.Pq Ql +
61or minus sign
62.Pq Ql -
63followed by a sequence of digits optionally containing
63a decimal-point character, optionally followed by an exponent. 64a decimal-point character, optionally followed by an exponent.
64An exponent consists of an ``E'' or ``e'', followed by an optional plus 65An exponent consists of an
65or minus sign, followed by a sequence of digits. 66.Sq E
67or
68.Sq e ,
69followed by an optional plus or minus sign, followed by a sequence of digits.
66.Pp 70.Pp
67Leading white-space characters in the string (as defined by the 71Leading whitespace characters in the string (as defined by the
68.Xr isspace 3 72.Xr isspace 3
69function) are skipped. 73function) are skipped.
70.Sh RETURN VALUES 74.Sh RETURN VALUES
@@ -88,18 +92,18 @@ is stored in the location referenced by
88If the correct value would cause overflow, plus or minus 92If the correct value would cause overflow, plus or minus
89.Dv HUGE_VAL 93.Dv HUGE_VAL
90is returned (according to the sign of the value), and 94is returned (according to the sign of the value), and
91.Dv ERANGE 95.Er ERANGE
92is stored in 96is stored in
93.Va errno . 97.Va errno .
94If the correct value would cause underflow, zero is 98If the correct value would cause underflow, zero is returned and
95returned and 99.Er ERANGE
96.Dv ERANGE 100is stored in
97is stored in
98.Va errno . 101.Va errno .
99.Sh ERRORS 102.Sh ERRORS
100.Bl -tag -width Er 103.Bl -tag -width Er
101.It Bq Er ERANGE 104.It Bq Er ERANGE
102Overflow or underflow occurred. 105Overflow or underflow occurred.
106.El
103.Sh SEE ALSO 107.Sh SEE ALSO
104.Xr atof 3 , 108.Xr atof 3 ,
105.Xr atoi 3 , 109.Xr atoi 3 ,
@@ -109,6 +113,5 @@ Overflow or underflow occurred.
109.Sh STANDARDS 113.Sh STANDARDS
110The 114The
111.Fn strtod 115.Fn strtod
112function 116function conforms to
113conforms to
114.St -ansiC . 117.St -ansiC .