Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2006-08-15 09:58:27


Looks good and we NEED it in Boost so that both lexical cast and
serialization work right.

signbit and isnan should go in Boost TR1? Not sure about the rest.

But an attempt to check is compiles with MSVC 8.0 failed - missing
.\c99_test.cpp in zip?
And something wrong in archive_test?

Suggestions?

Paul

PS A confirmation or check on whether gcc signbit works OK to check sign of
zero and NaN would be useful.

---
Paul A Bristow
Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
+44 1539561830 & SMS, Mobile +44 7714 330204 & SMS
pbristow_at_[hidden]
 
All messages:
------ Rebuild All started: Project: test, Configuration: Debug Win32 ------
Deleting intermediate and output files for project 'test', configuration
'Debug|Win32'
Compiling...
archive_test.cpp
j:\cpp\non_finite_num_facets\test\archive_test.cpp(34) : error C2065:
'archive_test' : undeclared identifier
j:\cpp\non_finite_num_facets\test\archive_test.cpp(35) : error C2448:
'BOOST_AUTO_UNIT_TEST' : function-style initializer appears to be a function
definition
c99_test.cpp
c1xx : fatal error C1083: Cannot open source file: '.\c99_test.cpp': No such
file or directory
extended_test.cpp
j:\cpp\non_finite_num_facets\test\extended_test.cpp(31) : error C2065:
'extended_test' : undeclared identifier
j:\cpp\non_finite_num_facets\test\extended_test.cpp(32) : error C2448:
'BOOST_AUTO_UNIT_TEST' : function-style initializer appears to be a function
definition
is_nan_test.cpp
j:\cpp\non_finite_num_facets\test\is_nan_test.cpp(35) : error C2065:
'is_nan_test' : undeclared identifier
j:\cpp\non_finite_num_facets\test\is_nan_test.cpp(36) : error C2448:
'BOOST_AUTO_UNIT_TEST' : function-style initializer appears to be a function
definition
lexical_cast_test.cpp
j:\cpp\non_finite_num_facets\test\lexical_cast_test.cpp(31) : error C2065:
'lexical_cast_test' : undeclared identifier
j:\cpp\non_finite_num_facets\test\lexical_cast_test.cpp(32) : error C2448:
'BOOST_AUTO_UNIT_TEST' : function-style initializer appears to be a function
definition
numeric_limits_test.cpp
j:\cpp\non_finite_num_facets\test\numeric_limits_test.cpp(18) : error C2065:
'numeric_limits_test' : undeclared identifier
j:\cpp\non_finite_num_facets\test\numeric_limits_test.cpp(19) : error C2448:
'BOOST_AUTO_UNIT_TEST' : function-style initializer appears to be a function
definition
sign_bit_test.cpp
j:\cpp\non_finite_num_facets\test\sign_bit_test.cpp(23) : error C2065:
'sign_bit_test' : undeclared identifier
j:\cpp\non_finite_num_facets\test\sign_bit_test.cpp(24) : error C2448:
'BOOST_AUTO_UNIT_TEST' : function-style initializer appears to be a function
definition
strict_test.cpp
j:\cpp\non_finite_num_facets\test\strict_test.cpp(28) : error C2065:
'strict_test' : undeclared identifier
j:\cpp\non_finite_num_facets\test\strict_test.cpp(29) : error C2448:
'BOOST_AUTO_UNIT_TEST' : function-style initializer appears to be a function
definition
test.cpp 
|  -----Original Message-----
|  From: boost-bounces_at_[hidden] 
|  [mailto:boost-bounces_at_[hidden]] On Behalf Of Johan Råde
|  Sent: 14 August 2006 16:19
|  To: boost_at_[hidden]
|  Subject: Re: [boost] [serialization] facets for non-finite numbers
|  
|  New version uploaded to the vault, with
|  
|  1. More documentation
|  2. Documentation in HTML format
|  3. Regression tests written with the Boost.Test library
|  
|  Where should the code live, if accepted into Boost?
|  The serialization library is not the right home.
|  
|  I would suggest the boost.math library.
|  This is a already a collection of unrelated sub-libraries, such as 
|  quaternion, special functions and greatest common divisor.
|  
|  --Johan Råde
|  
|  
|  
|  
|  Johan Råde wrote:
|   > ----- The Problem -----
|   >
|   > The C++98 standard does not specify how non-finite floating point
|   > numbers,
|   > such as infinity and not-a-number, should be represented 
|  in text streams.
|   > As a result, different platforms use different representations.
|   > This can cause undefined behavior when text files and 
|  serialization
|   > archives
|   > are moved between different platforms.
|   >
|   > Some platforms can not even read their own output!
|   > For instance, the following test fails with VC++ 7.1:
|   >
|   >    stringstream s;
|   >    double x = numeric_limits<double>::infinity();
|   >    double y;
|   >    ss << x;
|   >    ss >> y;
|   >    assert(x == y);
|   >
|   >
|   > ----- The Solution -----
|   >
|   > The facets extended_num_put and extended_num_get
|   > write and read non-finite floating point numbers
|   > to text streams in a consistent and portable manner.
|   >
|   > The following test succeeds with VC++ 7.1:
|   >
|   >    stringstream s;
|   >    locale old_locale;
|   >    locale tmp_locale(old_locale, new extended_num_put<char>);
|   >    locale new_locale(tmp_locale, new extended_num_get<char>);
|   >    s.imbue(new_locale);
|   >
|   >    double x = numeric_limits<double>::infinity();
|   >    double y;
|   >    ss << x;
|   >    ss >> y;
|   >    assert(x == y);
|   >
|  
|  _______________________________________________
|  Unsubscribe & other changes: 
|  http://lists.boost.org/mailman/listinfo.cgi/boost
|  

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk