Parses str interpreting its contents as a floating point number. In C++11 if the number in str is prefixed with 0x or 0X the string will be interpreted as a hex number. If there is no leading 0x or 0X the string will be interpreted as a decimal number. Optionally specify pos whose value is set to the position of the next character after the numerical value. The function ignores leading white space characters and interprets as many characters possible to form a valid floating point number. If no conversion could be performed, then an invalid_argument exception is thrown. If the value read is out of range of the return type, then an out_of_range exception is thrown.

Synopsis

Declared in <bslstl_string.h>

long double
stold(
    string const& str,
    std::size_t* pos = 0);

Created with MrDocs