mirror of
https://github.com/boostorg/conversion.git
synced 2025-08-02 14:04:28 +02:00
Fixes #6571 (documentation update, added 'why lexical_cast does not understand "-1.#IND"' question and answer to it)
[SVN r77118]
This commit is contained in:
@@ -167,6 +167,14 @@ if a negative number is read, no errors will arise and the result will be the tw
|
|||||||
`boost::lexical_cast` sees single `wchar_t` character as `unsigned short`. It is not a `boost::lexical_cast` mistake, but a
|
`boost::lexical_cast` sees single `wchar_t` character as `unsigned short`. It is not a `boost::lexical_cast` mistake, but a
|
||||||
limitation of compiler options that you use.
|
limitation of compiler options that you use.
|
||||||
|
|
||||||
|
[pre
|
||||||
|
]
|
||||||
|
|
||||||
|
* [*Question:] Why `boost::lexical_cast<double>("-1.#IND");` throws `boost::bad_lexical_cast`?
|
||||||
|
* [*Answer:] `"-1.#IND"` is a compiler extension, that violates standard. You shall input `"-nan"`, `"nan"`, `"inf"`
|
||||||
|
, `"-inf"` (case insensitive) strings to get NaN and Inf values. `boost::lexical_cast<string>` outputs `"-nan"`, `"nan"`,
|
||||||
|
`"inf"`, `"-inf"` strings, when has NaN or Inf input values.
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
[section Changes]
|
[section Changes]
|
||||||
|
Reference in New Issue
Block a user