.\" -*- coding: UTF-8 -*- .\" Copyright (c) 1990, 1991 The Regents of the University of California. .\" All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" the American National Standards Committee X3, on Information .\" Processing Systems. .\" .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB) .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. 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 BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" %%%LICENSE_END .\" .\" @(#)strtod.3 5.3 (Berkeley) 6/29/91 .\" .\" Modified Sun Aug 21 17:16:22 1994 by Rik Faith (faith@cs.unc.edu) .\" Modified Sat May 04 19:34:31 MET DST 1996 by Michael Haardt .\" (michael@cantor.informatik.rwth-aachen.de) .\" Added strof, strtold, aeb, 2001-06-07 .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH STRTOD 3 "1 Noviembre 2020" Linux "Manual del Programador de Linux" .SH NOMBRE strtod, strtof, strtold \- convierten una cadena ASCII a un número en coma flotante .SH SINOPSIS \fB#include \fP .PP \fBdouble strtod(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB);\fP .br \fBfloat strtof(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB);\fP .br \fBlong double strtold(const char *\fP\fInptr\fP\fB, char **\fP\fIendptr\fP\fB);\fP .PP .RS -4 Requisitos de Macros de Prueba de Características para glibc (véase \fBfeature_test_macros\fP(7)): .RE .ad l .PP \fBstrtof\fP(), \fBstrtold\fP(): .RS 4 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L .RE .ad .SH DESCRIPCIÓN Las funciones \fBstrtod\fP(), \fBstrtof\fP() y \fBstrtold\fP() convierten la porción inicial de la cadena a la que apunta \fInptr\fP a representación \fIdouble\fP, \fIfloat\fP, y \fIlong double\fP, respectivamente. .PP El formato esperado para (la porción inicial de) la cadena es un espacio inicial opcional, comprobado por \fBisspace\fP(3), un signo opcional de más (\*(lq+\*(rq) o menos (\*(lq\-\*(rq) seguido de (i) un número decimal, o (ii) un número hexadecimal, o (iii) un infinito, o (iv) un NAN (not\-a\-number). .PP Un \fInúmero decimal\fP consiste en una secuencia no vacía de dígitos decimales conteniendo posiblemente un carácter radical (punto decimal, dependiente de la localización, normalmente \*(lq.\*(rq), seguida opcionalmente por un exponente decimal. Un exponente decimal consiste en un carácter \*(lqE\*(rq o \*(lqe\*(rq, seguido por un signo opcional de más o menos, seguido por una secuencia no vacía de dígitos decimales, e indica multiplicación por una potencia de 10. .PP Un \fInúmero hexadecimal\fP consiste en una cadena \*(lq0x\*(rq o \*(lq0X\*(rq seguida por una secuencia no vacía de dígitos hexadecimales conteniendo posiblemente un carácter radical, seguida opcionalmente por un exponente binario. Un exponente binario consiste en un carácter \*(lqP\*(rq o \*(lqp\*(rq, seguido de un signo opcional de más o menos, seguido por una secuencia no vacía de dígitos decimales, e indica multiplicación por una potencia de 2. Al menos debe estar presente o el carácter radical o el exponente binario. .PP Un \fIinfinito\fP es o bien una cadena "INF" o "INFINITY", sin importar las mayúsuculas. .PP A \fINAN\fP is "NAN" (disregarding case) optionally followed by a string, \fI(n\-char\-sequence)\fP, where \fIn\-char\-sequence\fP specifies in an implementation\-dependent way the type of NAN (see NOTES). .SH "VALOR DEVUELTO" Esta funciones devuelven el valor convertido, si lo hay. .PP Si \fIendptr\fP no es NULL, un puntero al caracter tras el último caracter utilizado en la conversión es almacenado en la posición referenciada por \fIendptr\fP. .PP If no conversion is performed, zero is returned and (unless \fIendptr\fP is null) the value of \fInptr\fP is stored in the location referenced by \fIendptr\fP. .PP If the correct value would cause overflow, plus or minus \fBHUGE_VAL\fP, \fBHUGE_VALF\fP, or \fBHUGE_VALL\fP is returned (according to the return type and sign of the value), and \fBERANGE\fP is stored in \fIerrno\fP. .PP If the correct value would cause underflow, a value with magnitude no larger than \fBDBL_MIN\fP, \fBFLT_MIN\fP, or \fBLDBL_MIN\fP is returned and \fBERANGE\fP is stored in \fIerrno\fP. .SH ERRORES .TP \fBERANGE\fP Hubo desbordamiento por arriba o por abajo. .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lbw29 lb lb l l l. Interfaz Atributo Valor T{ \fBstrtod\fP(), \fBstrtof\fP(), \fBstrtold\fP() T} Seguridad del hilo Configuración regional de multi\-hilo seguro .TE .SH "CONFORME A" POSIX.1\-2001, POSIX.1\-2008, C99. .PP \fBstrtod\fP() was also described in C89. .SH NOTAS Since 0 can legitimately be returned on both success and failure, the calling program should set \fIerrno\fP to 0 before the call, and then determine if an error occurred by checking whether \fIerrno\fP has a nonzero value after the call. .PP .\" From glibc 2.8's stdlib/strtod_l.c: .\" We expect it to be a number which is put in the .\" mantissa of the number. .\" It looks as though at least FreeBSD (according to the manual) does .\" something similar. .\" C11 says: "An implementation may use the n-char sequence to determine .\" extra information to be represented in the NaN's significant." In the glibc implementation, the \fIn\-char\-sequence\fP that optionally follows "NAN" is interpreted as an integer number (with an optional '0' or '0x' prefix to select base 8 or 16) that is to be placed in the mantissa component of the returned value. .SH EJEMPLOS See the example on the \fBstrtol\fP(3) manual page; the use of the functions described in this manual page is similar. .SH "VÉASE TAMBIÉN" \fBatof\fP(3), \fBatoi\fP(3), \fBatol\fP(3), \fBnan\fP(3), \fBnanf\fP(3), \fBnanl\fP(3), \fBstrfromd\fP(3), \fBstrtol\fP(3), \fBstrtoul\fP(3) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Vicente Pastor Gómez y Miguel Pérez Ibars . Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org>. .ME .