Espacios de nombres
Variantes
Acciones

std::stof, std::stod, std::stold

De cppreference.com
< cpp‎ | string‎ | basic string
 
 
Strings biblioteca
Terminadas en nulo
Original:
Null-terminated strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Cadenas de bytes
Multibyte cuerdas
Cadenas anchas
Clases
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
std::basic_string
Las funciones miembro
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Elemento acceso
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Los iteradores
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Capacidad
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Operaciones
Original:
Operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Buscar
Original:
Search
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Constantes
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Terceros funciones
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)(C++11)(C++11)
(C++11)(C++11)
stofstodstold
(C++11)(C++11)(C++11)
(C++11)
(C++11)
Clases de ayuda
Original:
Helper classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Definido en la cabecera <string>
float       stof( const std::string& str, size_t *pos = 0 );
(1) (desde C++11)
double      stod( const std::string& str, size_t *pos = 0 );
(2) (desde C++11)
long double stold( const std::string& str, size_t *pos = 0 );
(3) (desde C++11)
Interpreta un valor de punto flotante en una cadena str .
Original:
Interprets a floating point value in a string str.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Función descarta los espacios en blanco (según lo determinado por std::isspace()) hasta que primero no está en blanco se encuentra. Luego se toma como caracteres posible para formar una representación válida de punto flotante y los convierte en valor de punto flotante. El valor válido de coma flotante puede ser uno de los siguientes:
Original:
Function discards any whitespace characters (as determined by std::isspace()) until first non-whitespace character is found. Then it takes as many characters as possible to form a valid floating point representation and converts them to floating point value. The valid floating point value can be one of the following:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • expresión decimal de coma flotante. Se compone de las siguientes partes:
    Original:
    decimal floating point expression. It consists of the following parts:
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (opcional) más o el signo menos
    Original:
    (opcional) plus or minus sign
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • no vacío secuencia de dígitos decimales que contiene opcionalmente un carácter de punto decimal (define mantisa)
    Original:
    nonempty sequence of decimal digits optionally containing a decimal point character (defines significand)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (opcional) e o E seguido con menos opcionales o signo más y la secuencia no vacía de dígitos decimales (define exponente)
    Original:
    (opcional) e or E followed with optional minus or plus sign and nonempty sequence of decimal digits (defines exponent)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • expresión binaria de punto flotante. Se compone de las siguientes partes:
    Original:
    binary floating point expression. It consists of the following parts:
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (opcional) más o el signo menos
    Original:
    (opcional) plus or minus sign
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 0x or 0X
  • no vacío secuencia de dígitos hexadecimales que contienen opcionalmente un carácter de punto decimal (define mantisa)
    Original:
    nonempty sequence of hexadecimal digits optionally containing a decimal point character (defines significand)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (opcional) p o P seguido con menos opcionales o signo más y la secuencia no vacía de dígitos hexadecimales (define exponente)
    Original:
    (opcional) p or P followed with optional minus or plus sign and nonempty sequence of hexadecimal digits (defines exponent)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • infinito expresión. Se compone de las siguientes partes:
    Original:
    infinity expression. It consists of the following parts:
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (opcional) más o el signo menos
    Original:
    (opcional) plus or minus sign
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • INF o INFINITY ignorando mayúsculas y minúsculas
    Original:
    INF or INFINITY ignoring case
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • no-un número-expresión. Se compone de las siguientes partes:
    Original:
    not-a-number expression. It consists of the following parts:
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (opcional) más o el signo menos
    Original:
    (opcional) plus or minus sign
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • NAN o NAN(' char_sequence ) ignorando caso de la parte NAN. Char_sequence' sólo puede contener caracteres alfanuméricos. El resultado es un tranquilo valor NaN punto flotante .
    Original:
    NAN or NAN(char_sequence) ignoring case of the NAN part. char_sequence can only contain alphanumeric characters. The result is a quiet NaN floating point value.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
El índice del carácter no convertido se almacena primero en pos. Si NULL se pasa como pos, se omite .
Original:
The index of the first unconverted character is stored in pos. If NULL is passed as pos, it is ignored.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Contenido

[editar] Parámetros

str -
la cadena a convertir
Original:
the string to convert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pos -
tratar de entero para almacenar el índice del carácter no convertido primero
Original:
address of integer to store the index of the first unconverted character
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Valor de retorno

La cadena convertida al tipo de punto flotante especificado .
Original:
The string converted to the specified floating point type.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Excepciones

std::invalid_argument si la conversión no se pudo realizar
Original:
std::invalid_argument if no conversion could be performed
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::out_of_range si el valor convertido caerían fuera de la gama del tipo del resultado .
Original:
std::out_of_range if the converted value would fall out of the range of the result type.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Ver también

(C++11)(C++11)(C++11)
convierte una cadena a un entero con signo
Original:
converts a string to an signed integer
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función) [editar]
(C++11)(C++11)
convierte una cadena a un entero sin signo
Original:
converts a string to an unsigned integer
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función) [editar]