[#bsl-stold-02]
= xref:bsl.adoc[bsl]::stold
:relfileprefix: ../
:mrdocs:

Parse a string as a `long double` value&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;string&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
long double
stold(
    xref:bsl/string.adoc[string] const& str,
    std::size&lowbar;t* pos = 0);
----

== Description

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

== Return Value

`long double` value parsed from `str`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *str*
| string to parse
| *pos*
| optional output for the index after the parsed value
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
