Make all bucket and overflow addresses unsigned
[unix-history] / usr / src / lib / libc / stdlib / strtod.3
CommitLineData
877ece0f
KB
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\" @(#)strtod.3 5.1 (Berkeley) %G%
7.\"
8.TH STRTOD 3 ""
9.UC 7
10.SH NAME
11strtod \- convert ASCII string to double
12.SH SYNOPSIS
13.nf
14.ft B
15#include <stdlib.h>
16
17double
18strtod(const char *nptr, char **endptr);
19.ft R
20.fi
21.SH DESCRIPTION
22The
23.I strtod
24function converts the initial portion of the string
25pointed to by
26.I nptr
27to
28.I double
29representation.
30.PP
31The expected form of the string is an optional plus (``+'') or minus
32sign (``-''), followed by a sequence of digits optionally containing
33a decimal-point character, optionally followed by an exponent.
34An exponent consists of an ``E'' or ``e'', followed by an optional plus
35or minus sign, followed by a sequence of digits.
36.PP
37Leading white-space characters in the string (as defined by the
38.IR isspace (3)
39function) are skipped.
40.PP
41The
42.I strtod
43function returns the converted value, if any.
44.PP
45If
46.I endptr
47is not NULL, a pointer to the character after the last character used
48in the conversion is stored in the location referenced by
49.IR endptr .
50.PP
51If no conversion is performed, zero is returned and the value of
52.I nptr
53is stored in the location referenced by
54.IR endptr .
55.PP
56If the correct value would cause overflow, plus or minus
57.I HUGE_VAL
58is returned (according to the sign of the value), and
59.I ERANGE
60is stored in
61.IR errno .
62If the correct value would cause underflow, zero is
63returned and
64.I ERANGE
65is stored in
66.IR errno .
67.SH ERRORS
68.TP
69[ERANGE]
70Overflow or underflow occurred.
71.SH "SEE ALSO"
72atof(3), atoi(3), atol(3), strtol(3), strtoul(3)
73.SH STANDARDS
74.B Strtod
75conforms to ANSI X3.159-1989 (``ANSI C'').
76.SH BUGS
77This manual page represents intent instead of actual practice.
78The
79.IR strtod (3)
80function is not currently available.