Boost logo

Boost-Commit :

From: john_at_[hidden]
Date: 2007-11-02 04:59:25


Author: johnmaddock
Date: 2007-11-02 04:59:24 EDT (Fri, 02 Nov 2007)
New Revision: 40678
URL: http://svn.boost.org/trac/boost/changeset/40678

Log:
Some minor tweaks to support Sun's compiler on Linux.
Text files modified:
   trunk/libs/math/test/test_normal.cpp | 2 +-
   trunk/libs/math/test/test_poisson.cpp | 2 +-
   trunk/libs/math/test/test_students_t.cpp | 2 +-
   3 files changed, 3 insertions(+), 3 deletions(-)

Modified: trunk/libs/math/test/test_normal.cpp
==============================================================================
--- trunk/libs/math/test/test_normal.cpp (original)
+++ trunk/libs/math/test/test_normal.cpp 2007-11-02 04:59:24 EDT (Fri, 02 Nov 2007)
@@ -81,7 +81,7 @@
 void test_spots(RealType)
 {
    // Basic sanity checks
- RealType tolerance = static_cast<RealType>(std::pow(10., -(4-2))); // 1e-4 (as %)
+ RealType tolerance = 1e-2f; // 1e-4 (as %)
    // Some tests only pass at 1e-4 because values generated by
    // http://faculty.vassar.edu/lowry/VassarStats.html
    // give only 5 or 6 *fixed* places, so small values have fewer digits.

Modified: trunk/libs/math/test/test_poisson.cpp
==============================================================================
--- trunk/libs/math/test/test_poisson.cpp (original)
+++ trunk/libs/math/test/test_poisson.cpp 2007-11-02 04:59:24 EDT (Fri, 02 Nov 2007)
@@ -63,7 +63,7 @@
   }
 
    decdigits -= 1; // Perhaps allow some decimal digit(s) margin of numerical error.
- RealType tolerance = static_cast<RealType>(std::pow(10., -(decdigits-2))); // 1e-6 (-2 so as %)
+ RealType tolerance = static_cast<RealType>(std::pow(10., static_cast<double>(2-decdigits))); // 1e-6 (-2 so as %)
    tolerance *= 2; // Allow some bit(s) small margin (2 means + or - 1 bit) of numerical error.
    // Typically 2e-13% = 2e-15 as fraction for double.
 

Modified: trunk/libs/math/test/test_students_t.cpp
==============================================================================
--- trunk/libs/math/test/test_students_t.cpp (original)
+++ trunk/libs/math/test/test_students_t.cpp 2007-11-02 04:59:24 EDT (Fri, 02 Nov 2007)
@@ -54,7 +54,7 @@
 void test_spots(RealType)
 {
   // Basic sanity checks
- RealType tolerance = static_cast<RealType>(std::pow(10., -(6-2))); // 1e-6 (as %)
+ RealType tolerance = 1e-4; // 1e-6 (as %)
    // Some tests only pass at 1e-5 because probability value is less accurate,
    // a digit in 6th decimal place, although calculated using
    // a t-distribution generator (claimed 6 decimal digits) at


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