summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/strtod.3
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2007-12-16 21:19:28 +0000
committerdas <das@FreeBSD.org>2007-12-16 21:19:28 +0000
commitbb384eba43f6fa8d7c4e8bc5904985d7438b3ed4 (patch)
tree2cbe77198dcb8b739e1c217a414214adc49077f9 /lib/libc/stdlib/strtod.3
parent1cc7475e872b281213100f41c9593400e47590d8 (diff)
downloadFreeBSD-src-bb384eba43f6fa8d7c4e8bc5904985d7438b3ed4.zip
FreeBSD-src-bb384eba43f6fa8d7c4e8bc5904985d7438b3ed4.tar.gz
Implement and document nan(), nanf(), and nanl(). This commit
adds two new directories in msun: ld80 and ld128. These are for long double functions specific to the 80-bit long double format used on x86-derived architectures, and the 128-bit format used on sparc64, respectively.
Diffstat (limited to 'lib/libc/stdlib/strtod.3')
-rw-r--r--lib/libc/stdlib/strtod.327
1 files changed, 23 insertions, 4 deletions
diff --git a/lib/libc/stdlib/strtod.3 b/lib/libc/stdlib/strtod.3
index 33dd452..ec8ad51 100644
--- a/lib/libc/stdlib/strtod.3
+++ b/lib/libc/stdlib/strtod.3
@@ -86,8 +86,28 @@ For hexadecimal constants, the scaling is instead done by powers
of 2.
.Pp
Alternatively, if the portion of the string following the optional
-plus or minus sign begins with ``INFINITY'' or ``NAN'', ignoring
-case, it is interpreted as an infinity or a quiet NaN, respectively.
+plus or minus sign begins with
+.Dq INFINITY
+or
+.Dq NAN ,
+ignoring case, it is interpreted as an infinity or a quiet \*(Na,
+respectively.
+The syntax
+.Dq Xo Pf NAN( Ar "s" ) Xc ,
+where
+.Ar s
+is an alphanumeric string, produces the same value as the call
+.Fo nan
+.Qq Ar s Ns
+.Fc
+(respectively,
+.Fo nanf
+.Qq Ar s Ns
+.Fc
+and
+.Fo nanl
+.Qq Ar s Ns
+.Fc . )
.Pp
In any of the above cases, leading white-space characters in the
string (as defined by the
@@ -140,6 +160,7 @@ Overflow or underflow occurred.
.Xr atof 3 ,
.Xr atoi 3 ,
.Xr atol 3 ,
+.Xr nan 3 ,
.Xr strtol 3 ,
.Xr strtoul 3 ,
.Xr wcstod 3
@@ -177,5 +198,3 @@ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
.Ed
-.Sh BUGS
-These routines do not recognize the C99 ``NaN(...)'' syntax.
OpenPOWER on IntegriCloud