
6 Jul
2006
6 Jul
'06
12:35 p.m.
Following a suggestion of Robert Ramey's, I have put together facets for writing and reading non-finite floating point numbers, such as infinity and nan, to text streams, in a consistent and portable way. This is useful when serializing to text archives, but should have other applications as well. I have attached a zip file. It contains three files: 1. the actual code: non_finite_num_facets.hpp 2. documentation: non_finite_num_facets_doc.txt 3. tests: non_finite_num_facets_test.cpp The code handles char and wchar_t. It handles float, double and long double. The code has been tested with VC++ 7.1 but should work with other compilers as well. Any feedback is wellcome. --Johan Råde (rade@maths.lth.se)