summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2016-11-04 18:46:15 +0000
committerriastradh <riastradh@NetBSD.org>2016-11-04 18:46:15 +0000
commitc52085b2b01e9b3f8b6a575c6fd5ffcb926faae1 (patch)
tree6aa84923b278f961a30d3f614664658ba4da51c7 /lib/libc/stdlib
parentfb324ad3ea2b7bf8cc12393e5891c26f6db0bfe8 (diff)
Fix description of ERANGE cases again.
Do use the technical terms `overflow' and `underflow', because strtod sets ERANGE precisely to indicate either of these two conditions, and they are the right keywords that one might be looking for. Note that strtod may set ERANGE even if it returns noninfinity and nonzero -- specifically, if the result is subnormal. This part was wrong before I `fixed' it and remained wrong after I `fixed' it earlier this year.
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/strtod.316
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/libc/stdlib/strtod.3 b/lib/libc/stdlib/strtod.3
index e0839bb3912..795d5679b7d 100644
--- a/lib/libc/stdlib/strtod.3
+++ b/lib/libc/stdlib/strtod.3
@@ -1,4 +1,4 @@
-.\" $NetBSD: strtod.3,v 1.22 2016/03/17 09:43:38 wiz Exp $
+.\" $NetBSD: strtod.3,v 1.23 2016/11/04 18:46:15 riastradh Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -33,7 +33,7 @@
.\"
.\" from: @(#)strtod.3 8.1 (Berkeley) 6/4/93
.\"
-.Dd March 17, 2016
+.Dd November 4, 2016
.Dt STRTOD 3
.Os
.Sh NAME
@@ -151,8 +151,9 @@ If no conversion is performed, zero is returned and the value of
is stored in the location referenced by
.Fa endptr .
.Pp
-If the correct value is too large in magnitude to be represented, plus
-or minus
+If the correct value is too large in magnitude to be represented
+.Pq Sq overflow ,
+plus or minus
.Dv HUGE_VAL ,
.Dv HUGE_VALF ,
or
@@ -161,8 +162,11 @@ is returned (according to the return type and sign of the value), and
.Dv ERANGE
is stored in
.Va errno .
-If the correct value is nonzero but too small in magnitude to be
-represented as nonzero, zero is returned and
+.Pp
+If the correct value is too small in magnitude to be represented
+normally with full precision
+.Pq Sq underflow ,
+the closest subnormal value, or zero, is returned, and
.Dv ERANGE
is stored in
.Va errno .