Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77118 - trunk/libs/conversion/doc
From: antoshkka_at_[hidden]
Date: 2012-02-26 04:19:59


Author: apolukhin
Date: 2012-02-26 04:19:55 EST (Sun, 26 Feb 2012)
New Revision: 77118
URL: http://svn.boost.org/trac/boost/changeset/77118

Log:
Fixes #6571 (documentation update, added 'why lexical_cast does not understand "-1.#IND"' question and answer to it)
Text files modified:
   trunk/libs/conversion/doc/lexical_cast.qbk | 8 ++++++++
   1 files changed, 8 insertions(+), 0 deletions(-)

Modified: trunk/libs/conversion/doc/lexical_cast.qbk
==============================================================================
--- trunk/libs/conversion/doc/lexical_cast.qbk (original)
+++ trunk/libs/conversion/doc/lexical_cast.qbk 2012-02-26 04:19:55 EST (Sun, 26 Feb 2012)
@@ -167,6 +167,14 @@
 `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.
 
+[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]
 
 [section Changes]


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk