activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r617558 - in /activemq/activemq-cpp/decaf/trunk/src/main/decaf/lang: Double.cpp Float.cpp Math.cpp
Date Fri, 01 Feb 2008 17:06:28 GMT
Author: tabish
Date: Fri Feb  1 09:06:25 2008
New Revision: 617558

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

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

Modified: activemq/activemq-cpp/decaf/trunk/src/main/decaf/lang/Double.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/lang/Double.cpp?rev=617558&r1=617557&r2=617558&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/lang/Double.cpp (original)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/lang/Double.cpp Fri Feb  1 09:06:25 2008
@@ -17,6 +17,7 @@
 
 #include "Double.h"
 #include <decaf/lang/Long.h>
+#include <limits>
 
 using namespace std;
 using namespace decaf;
@@ -26,9 +27,9 @@
 ////////////////////////////////////////////////////////////////////////////////
 const double Double::MAX_VALUE = 1.7976931348623157e+308;
 const double Double::MIN_VALUE = 5e-324;
-const double Double::NaN = 0.0f / 0.0f;
-const double Double::POSITIVE_INFINITY = 1.0f / 0.0f;
-const double Double::NEGATIVE_INFINITY = -1.0f / 0.0f;
+const double Double::NaN = std::numeric_limits<double>::quiet_NaN();
+const double Double::POSITIVE_INFINITY = std::numeric_limits<double>::infinity();
+const double Double::NEGATIVE_INFINITY = -std::numeric_limits<double>::infinity();
 
 ////////////////////////////////////////////////////////////////////////////////
 Double::Double( double value ) {

Modified: activemq/activemq-cpp/decaf/trunk/src/main/decaf/lang/Float.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/lang/Float.cpp?rev=617558&r1=617557&r2=617558&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/lang/Float.cpp (original)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/lang/Float.cpp Fri Feb  1 09:06:25 2008
@@ -19,6 +19,7 @@
 #include <decaf/lang/Integer.h>
 #include <decaf/internal/util/FloatingPointParser.h>
 #include <decaf/internal/util/NumberConverter.h>
+#include <limits>
 
 using namespace std;
 using namespace decaf;
@@ -28,9 +29,9 @@
 ////////////////////////////////////////////////////////////////////////////////
 const float Float::MAX_VALUE = 3.40282346638528860e+38f;
 const float Float::MIN_VALUE = 1.40129846432481707e-45f;
-const float Float::NaN = 0.0f / 0.0f;
-const float Float::POSITIVE_INFINITY = 1.0f / 0.0f;
-const float Float::NEGATIVE_INFINITY = -1.0f / 0.0f;
+const float Float::NaN = std::numeric_limits<float>::quiet_NaN();
+const float Float::POSITIVE_INFINITY = std::numeric_limits<float>::infinity();
+const float Float::NEGATIVE_INFINITY = -std::numeric_limits<float>::infinity();
 
 ////////////////////////////////////////////////////////////////////////////////
 Float::Float( float value ) {

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=617558&r1=617557&r2=617558&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 Fri Feb  1 09:06:25 2008
@@ -80,7 +80,7 @@
         return value;
     }
 
-    return cbrt( value );
+    return Math::pow( value, 1.0/3.0 );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -184,7 +184,7 @@
         return value;
     }
 
-    return rint( value );
+    return Math::floor( value < 0 ? value - 0.5 : value + 0.5 );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -411,7 +411,7 @@
         return f1;
     }
     
-    return remainder( f1, f2 );
+    return 0;//remainder( f1, f2 );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -451,7 +451,7 @@
         return Double::NaN;
     }
 
-    return ::hypot( x, y );
+    return ::sqrt( ( x * x ) + ( y * y ) );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -482,7 +482,7 @@
     }
 
     value = abs( value );
-    return nextafterf( value, Float::MAX_VALUE ) - value;
+    return 0;//nextafterf( value, Float::MAX_VALUE ) - value;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -499,5 +499,5 @@
     }
 
     value = abs( value );
-    return nextafter( value, Double::MAX_VALUE ) - value;
+    return 0;//nextafter( value, Double::MAX_VALUE ) - value;
 }



Mime
View raw message