summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormartynas <>2012-09-15 11:47:04 +0000
committermartynas <>2012-09-15 11:47:04 +0000
commit0df9f61c6af695b23cd2de2d71d5b63f986c5c9f (patch)
tree20447e56daaf1b7ecbfad9969ba3a44e4c65081f /src
parent4839ce6b30eb9046e22e3e71d26c85a422a7c2ba (diff)
downloadopenbsd-0df9f61c6af695b23cd2de2d71d5b63f986c5c9f.tar.gz
openbsd-0df9f61c6af695b23cd2de2d71d5b63f986c5c9f.tar.bz2
openbsd-0df9f61c6af695b23cd2de2d71d5b63f986c5c9f.zip
Document that strtod functions accept INF, NAN, NAN(). From Michal Mazurek.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/stdlib/strtod.331
1 files changed, 28 insertions, 3 deletions
diff --git a/src/lib/libc/stdlib/strtod.3 b/src/lib/libc/stdlib/strtod.3
index f1fc781f7d..13db821c68 100644
--- a/src/lib/libc/stdlib/strtod.3
+++ b/src/lib/libc/stdlib/strtod.3
@@ -29,9 +29,9 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
31.\" 31.\"
32.\" $OpenBSD: strtod.3,v 1.14 2008/09/13 22:48:45 martynas Exp $ 32.\" $OpenBSD: strtod.3,v 1.15 2012/09/15 11:47:04 martynas Exp $
33.\" 33.\"
34.Dd $Mdocdate: September 13 2008 $ 34.Dd $Mdocdate: September 15 2012 $
35.Dt STRTOD 3 35.Dt STRTOD 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -87,7 +87,32 @@ or
87.Sq e , 87.Sq e ,
88followed by an optional plus or minus sign, followed by a sequence of digits. 88followed by an optional plus or minus sign, followed by a sequence of digits.
89.Pp 89.Pp
90Leading whitespace characters in the string (as defined by the 90Alternatively, if the portion of the string following the optional
91plus or minus sign begins with
92.Dq INF
93or
94.Dq NAN ,
95ignoring case, it is interpreted as an infinity or a quiet \*(Na,
96respectively.
97The syntax
98.Dq Xo Pf NAN( Ar "s" ) Xc ,
99where
100.Ar s
101is an alphanumeric string, produces the same value as the call
102.Fo nan
103.Qq Ar s Ns
104.Fc
105(respectively,
106.Fo nanf
107.Qq Ar s Ns
108.Fc
109and
110.Fo nanl
111.Qq Ar s Ns
112.Fc . )
113.Pp
114In any of the above cases, leading whitespace characters in the
115string (as defined by the
91.Xr isspace 3 116.Xr isspace 3
92function) are skipped. 117function) are skipped.
93.Sh RETURN VALUES 118.Sh RETURN VALUES