OSDN Git Service

2009-05-15 David Billinghurst <billingd@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / 26_numerics / random / piecewise_linear_distribution / cons / initlist_fun.cc
index 3f04989..f1b24ea 100644 (file)
@@ -39,8 +39,10 @@ struct cosine_distribution
         return 0.0;
       else if (x - _M_x0 > _M_lambda / 4)
         return 0.0;
-      else
-        return std::cos(2 * M_PI * (x - _M_x0) / _M_lambda);
+      else {
+        const double pi = 3.1415926535897932384626433832795029L;
+        return std::cos(2 * pi * (x - _M_x0) / _M_lambda);
+      }
     }
 
 private: