File:  [CSRG BSD Unix] / 43BSDReno / lib / libc / stdlib / strtod.3
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:55 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

.\" Copyright (c) 1990 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms are permitted
.\" provided that: (1) source distributions retain this entire copyright
.\" notice and comment, and (2) distributions including binaries display
.\" the following acknowledgement:  ``This product includes software
.\" developed by the University of California, Berkeley and its contributors''
.\" in the documentation or other materials provided with the distribution
.\" and in all advertising materials mentioning features or use of this
.\" software. Neither the name of the University nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
.\"	@(#)strtod.3	5.1 (Berkeley) 5/16/90
.\"
.TH STRTOD 3 "May 16, 1990"
.UC 7
.SH NAME
strtod \- convert ASCII string to double
.SH SYNOPSIS
.nf
.ft B
#include <stdlib.h>

double
strtod(const char *nptr, char **endptr);
.ft R
.fi
.SH DESCRIPTION
The
.I strtod
function converts the initial portion of the string 
pointed to by
.I nptr
to
.I double
representation.
.PP
The expected form of the string is an optional plus (``+'') or minus
sign (``-''), followed by a sequence of digits optionally containing
a decimal-point character, optionally followed by an exponent.
An exponent consists of an ``E'' or ``e'', followed by an optional plus
or minus sign, followed by a sequence of digits.
.PP
Leading white-space characters in the string (as defined by the
.IR isspace (3)
function) are skipped.
.PP
The
.I strtod
function returns the converted value, if any.
.PP
If
.I endptr
is not NULL, a pointer to the character after the last character used
in the conversion is stored in the location referenced by
.IR endptr .
.PP
If no conversion is performed, zero is returned and the value of
.I nptr
is stored in the location referenced by
.IR endptr .
.PP
If the correct value would cause overflow, plus or minus
.I HUGE_VAL
is returned (according to the sign of the value), and
.I ERANGE
is stored in
.IR errno .
If the correct value would cause underflow, zero is
returned and
.I ERANGE
is stored in 
.IR errno .
.SH ERRORS
.TP
[ERANGE]
Overflow or underflow occurred.
.SH "SEE ALSO"
atof(3), atoi(3), atol(3), strtol(3), strtoul(3)
.SH STANDARDS
.B Strtod
conforms to ANSI X3.159-1989 (``ANSI C'').
.SH BUGS
This manual page represents intent instead of actual practice.
The
.IR strtod (3)
function is not currently available.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.