Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71441 - trunk/libs/math/example
From: pbristow_at_[hidden]
Date: 2011-04-23 10:19:04


Author: pbristow
Date: 2011-04-23 10:19:03 EDT (Sat, 23 Apr 2011)
New Revision: 71441
URL: http://svn.boost.org/trac/boost/changeset/71441

Log:
Added check that infinity supported. and ends with newline.
Text files modified:
   trunk/libs/math/example/nonfinite_signaling_NaN.cpp | 12 ++++++++++++
   1 files changed, 12 insertions(+), 0 deletions(-)

Modified: trunk/libs/math/example/nonfinite_signaling_NaN.cpp
==============================================================================
--- trunk/libs/math/example/nonfinite_signaling_NaN.cpp (original)
+++ trunk/libs/math/example/nonfinite_signaling_NaN.cpp 2011-04-23 10:19:03 EDT (Sat, 23 Apr 2011)
@@ -46,6 +46,18 @@
 
 int main()
 {
+ if((std::numeric_limits<double>::has_infinity == false) || (std::numeric_limits<double>::infinity() == 0))
+ {
+ std::cout << "Infinity not supported on this platform." << std::endl;
+ return 0;
+ }
+
+ if((std::numeric_limits<double>::has_quiet_NaN == false) || (std::numeric_limits<double>::quiet_NaN() == 0))
+ {
+ std::cout << "NaN not supported on this platform." << std::endl;
+ return 0;
+ }
+
   locale default_locale; // Current global locale.
   // Try to use the default locale first.
   // On MSVC this doesn't work.


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