|
|
1.1 ! root 1: .\" Copyright (c) 1990 The Regents of the University of California. ! 2: .\" All rights reserved. ! 3: .\" ! 4: .\" Redistribution and use in source and binary forms are permitted ! 5: .\" provided that: (1) source distributions retain this entire copyright ! 6: .\" notice and comment, and (2) distributions including binaries display ! 7: .\" the following acknowledgement: ``This product includes software ! 8: .\" developed by the University of California, Berkeley and its contributors'' ! 9: .\" in the documentation or other materials provided with the distribution ! 10: .\" and in all advertising materials mentioning features or use of this ! 11: .\" software. Neither the name of the University nor the names of its ! 12: .\" contributors may be used to endorse or promote products derived ! 13: .\" from this software without specific prior written permission. ! 14: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 15: .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 16: .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 17: .\" ! 18: .\" @(#)strtod.3 5.1 (Berkeley) 5/16/90 ! 19: .\" ! 20: .TH STRTOD 3 "May 16, 1990" ! 21: .UC 7 ! 22: .SH NAME ! 23: strtod \- convert ASCII string to double ! 24: .SH SYNOPSIS ! 25: .nf ! 26: .ft B ! 27: #include <stdlib.h> ! 28: ! 29: double ! 30: strtod(const char *nptr, char **endptr); ! 31: .ft R ! 32: .fi ! 33: .SH DESCRIPTION ! 34: The ! 35: .I strtod ! 36: function converts the initial portion of the string ! 37: pointed to by ! 38: .I nptr ! 39: to ! 40: .I double ! 41: representation. ! 42: .PP ! 43: The expected form of the string is an optional plus (``+'') or minus ! 44: sign (``-''), followed by a sequence of digits optionally containing ! 45: a decimal-point character, optionally followed by an exponent. ! 46: An exponent consists of an ``E'' or ``e'', followed by an optional plus ! 47: or minus sign, followed by a sequence of digits. ! 48: .PP ! 49: Leading white-space characters in the string (as defined by the ! 50: .IR isspace (3) ! 51: function) are skipped. ! 52: .PP ! 53: The ! 54: .I strtod ! 55: function returns the converted value, if any. ! 56: .PP ! 57: If ! 58: .I endptr ! 59: is not NULL, a pointer to the character after the last character used ! 60: in the conversion is stored in the location referenced by ! 61: .IR endptr . ! 62: .PP ! 63: If no conversion is performed, zero is returned and the value of ! 64: .I nptr ! 65: is stored in the location referenced by ! 66: .IR endptr . ! 67: .PP ! 68: If the correct value would cause overflow, plus or minus ! 69: .I HUGE_VAL ! 70: is returned (according to the sign of the value), and ! 71: .I ERANGE ! 72: is stored in ! 73: .IR errno . ! 74: If the correct value would cause underflow, zero is ! 75: returned and ! 76: .I ERANGE ! 77: is stored in ! 78: .IR errno . ! 79: .SH ERRORS ! 80: .TP ! 81: [ERANGE] ! 82: Overflow or underflow occurred. ! 83: .SH "SEE ALSO" ! 84: atof(3), atoi(3), atol(3), strtol(3), strtoul(3) ! 85: .SH STANDARDS ! 86: .B Strtod ! 87: conforms to ANSI X3.159-1989 (``ANSI C''). ! 88: .SH BUGS ! 89: This manual page represents intent instead of actual practice. ! 90: The ! 91: .IR strtod (3) ! 92: function is not currently available.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.