*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> strtod (3c)              
Title
Content
Arch
Section
 

Contents


strtod(3C)							    strtod(3C)


NAME    [Toc]    [Back]

     strtod, atof, strtold, atold - convert string to double-precision or long
     double-precision number

SYNOPSIS    [Toc]    [Back]

     #include <stdlib.h>

     double strtod (const char *nptr, char **endptr);

     double atof (const	char *nptr);

     long double strtold (const	char *nptr, char **endptr);

     long double atold (const char *nptr);

DESCRIPTION    [Toc]    [Back]

     (Note that	the long double	routines are only valid	for the	MIPSpro
     compilers.)

     strtod returns as a double-precision floating-point number	the value
     represented by the	character string pointed to by nptr.
     Similarly,	strtold	returns	as a long double-precision floating-point
     number the	value represented by the character string pointed to by	nptr.
     Each function scans the string up to the first unrecognized character.

     strtod and	strtold	recognize an optional string of	``white-space''
     characters	[as defined by isspace in ctype(3C)], then an optional sign,
     then a string of digits optionally	containing a decimal-point character
     [as specified by the current locale; see setlocale(3C)], then an optional
     exponent part including an	e or E followed	by an optional sign, followed
     by	an integer.

     If	the value of endptr is not (char **)NULL, a pointer to the character
     terminating the scan is returned in the location pointed to by endptr.
     If	no number can be formed, *endptr is set	to nptr, and zero is returned.

     atof(nptr)	is equivalent to:
	  strtod(nptr, (char **)NULL).

     atold(nptr) is equivalent to:
	  strtold(nptr,	(char **)NULL).

SEE ALSO    [Toc]    [Back]

      
      
     ctype(3C),	strtol(3C), scanf(3S).

NOTE    [Toc]    [Back]

     Precision may be silently lost if the number of digits comprising the
     floating-point number (i.e., not including	the exponent) exceeds the
     value of the constant DBL_DIG (LDBL_DIG) in <float.h>.






									Page 1






strtod(3C)							    strtod(3C)


DIAGNOSTICS    [Toc]    [Back]

     If	the correct value would	cause overflow,	+/-HUGE_VAL is returned
     (according	to the sign of the value), and errno is	set to ERANGE.

     If	the correct value would	cause underflow, zero is returned and errno is
     set to ERANGE.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
wcstod IRIX convert wide-character string to double-precision number
dprod IRIX FORTRAN double precision and quad precision product intrinsic functions
sqrt IRIX single and double precision sqrt function.
dlamch IRIX determine double precision machine parameters
wcstod Tru64 Convert a wide-character string to a double-precision value
DTRCO IRIX DTRCO estimates the condition of a double precision triangular matrix.
wcstold Tru64 Convert a wide-character string to a long double-precision value
dzsum1 IRIX take the sum of the absolute values of a complex vector and returns a double precision result
DTRDI IRIX DTRDI computes the determinant and inverse of a double precision triangular matrix.
DSPSL IRIX DSISL solves the double precision symmetric system A * X = B using the factors computed by DSPFA.
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service