activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r617794 - /activemq/activemq-cpp/decaf/trunk/src/main/decaf/lang/Math.cpp
Date Sat, 02 Feb 2008 13:34:39 GMT
Author: tabish
Date: Sat Feb  2 05:34:38 2008
New Revision: 617794

URL: http://svn.apache.org/viewvc?rev=617794&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-103

The code for unix works, but won't compile on windows for now we will have to live with that.
 We may need to add fdlibm if we want those methods to work on windows.

Modified:
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/lang/Math.cpp

Modified: activemq/activemq-cpp/decaf/trunk/src/main/decaf/lang/Math.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/lang/Math.cpp?rev=617794&r1=617793&r2=617794&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/lang/Math.cpp (original)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/lang/Math.cpp Sat Feb  2 05:34:38 2008
@@ -21,9 +21,11 @@
 #include <decaf/lang/Integer.h>
 #include <decaf/lang/Long.h>
 #include <decaf/util/Random.h>
+#include <decaf/internal/util/BitOps.h>
 
 using namespace decaf;
 using namespace decaf::lang;
+using namespace decaf::internal::util;
 
 #include <cmath>
 #include <cstdio>
@@ -80,7 +82,7 @@
         return value;
     }
 
-    return Math::pow( value, 1.0/3.0 );
+    return ::cbrt( value );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -184,7 +186,7 @@
         return value;
     }
 
-    return Math::floor( value < 0 ? value - 0.5 : value + 0.5 );
+    return ::rint( value );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -214,7 +216,7 @@
         return value;
     }
 
-    return expm1( value );
+    return ::expm1( value );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -351,7 +353,7 @@
         return value;
     }
 
-    return log1p( value );
+    return ::log1p( value );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -410,8 +412,8 @@
     } else if( Double::isInfinite( f2 ) ) {
         return f1;
     }
-    
-    return 0;//remainder( f1, f2 );
+
+    return ::remainder( f1, f2 );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -482,7 +484,7 @@
     }
 
     value = abs( value );
-    return 0;//nextafterf( value, Float::MAX_VALUE ) - value;
+    return ::nextafterf( value, Float::MAX_VALUE ) - value;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -499,5 +501,5 @@
     }
 
     value = abs( value );
-    return 0;//nextafter( value, Double::MAX_VALUE ) - value;
+    return ::nextafter( value, Double::MAX_VALUE ) - value;
 }



Mime
View raw message