Module Name:    src
Committed By:   riastradh
Date:           Fri Nov  4 18:46:15 UTC 2016

Modified Files:
        src/lib/libc/stdlib: strtod.3

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/stdlib/strtod.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/stdlib/strtod.3
diff -u src/lib/libc/stdlib/strtod.3:1.22 src/lib/libc/stdlib/strtod.3:1.23
--- src/lib/libc/stdlib/strtod.3:1.22	Thu Mar 17 09:43:38 2016
+++ src/lib/libc/stdlib/strtod.3	Fri Nov  4 18:46:15 2016
@@ -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 r
 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 typ
 .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 .

Reply via email to