.\" -*- coding: UTF-8 -*- '\" t .\" 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. .\" .\" SPDX-License-Identifier: BSD-4-Clause-UC .\" .\" @(#)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 "5 Febrero 2023" "Páginas de manual de Linux 6.03" .SH NOMBRE strtod, strtof, strtold \- convierten una cadena ASCII a un número en coma flotante .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .SH SINOPSIS .nf \fB#include \fP .PP \fBdouble strtod(const char *restrict \fP\fInptr\fP\fB, char **restrict \fP\fIendptr\fP\fB);\fP \fBfloat strtof(const char *restrict \fP\fInptr\fP\fB, char **restrict \fP\fIendptr\fP\fB);\fP \fBlong double strtold(const char *restrict \fP\fInptr\fP\fB, char **restrict \fP\fIendptr\fP\fB);\fP .fi .PP .RS -4 Requisitos de Macros de Prueba de Características para glibc (véase \fBfeature_test_macros\fP(7)): .RE .PP \fBstrtof\fP(), \fBstrtold\fP(): .nf _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L .fi .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 The expected form of the (initial portion of the) string is optional leading white space as recognized by \fBisspace\fP(3), an optional plus (\[aq]+\[aq]) or minus sign (\[aq]\-\[aq]) and then either (i) a decimal number, or (ii) a hexadecimal number, or (iii) an infinity, or (iv) a NAN (not\-a\-number). .PP A \fIdecimal number\fP consists of a nonempty sequence of decimal digits possibly containing a radix character (decimal point, locale\-dependent, usually \[aq].\[aq]), optionally followed by a decimal exponent. A decimal exponent consists of an \[aq]E\[aq] or \[aq]e\[aq], followed by an optional plus or minus sign, followed by a nonempty sequence of decimal digits, and indicates multiplication by a power of 10. .PP A \fIhexadecimal number\fP consists of a "0x" or "0X" followed by a nonempty sequence of hexadecimal digits possibly containing a radix character, optionally followed by a binary exponent. A binary exponent consists of a \[aq]P\[aq] or \[aq]p\[aq], followed by an optional plus or minus sign, followed by a nonempty sequence of decimal digits, and indicates multiplication by a power of 2. At least one of radix character and binary exponent must be present. .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 carácter tras el último carácter utilizado en la conversión es almacenado en la posición referenciada por \fIendptr\fP. .PP Si no se realizó conversión, se devuelve cero y el valor de \fInptr\fP es almacenado en la posición referenciada por \fIendptr\fP, salvo que \fIendptr\fP sea nulo. .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). .ad l .nh .TS allbox; lbx 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 .hy .ad .sp 1 .SH ESTÁNDARES POSIX.1\-2001, POSIX.1\-2008, C99. .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) .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Vicente Pastor Gómez , Miguel Pérez Ibars y Marcos Fouces . .PP 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. .PP 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 .