You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2007/08/08 23:35:56 UTC

svn commit: r564026 - in /activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang: Double.cpp Float.cpp Math.cpp

Author: tabish
Date: Wed Aug  8 14:35:52 2007
New Revision: 564026

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

Working on full implementation of Math

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

Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Double.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Double.cpp?view=diff&rev=564026&r1=564025&r2=564026
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Double.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Double.cpp Wed Aug  8 14:35:52 2007
@@ -25,7 +25,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 const double Double::MAX_VALUE = 1.7976931348623157e+308;
-const double Double::MIN_VALUE = 2.2250738585072014e-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;

Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Float.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Float.cpp?view=diff&rev=564026&r1=564025&r2=564026
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Float.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Float.cpp Wed Aug  8 14:35:52 2007
@@ -24,8 +24,8 @@
 using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-const float Float::MAX_VALUE = 3.40282347e+38F;
-const float Float::MIN_VALUE = 1.17549435e-38F;
+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;

Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Math.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Math.cpp?view=diff&rev=564026&r1=564025&r2=564026
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Math.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Math.cpp Wed Aug  8 14:35:52 2007
@@ -111,7 +111,7 @@
 
     if( Double::isNaN( value ) || Double::isInfinite( value ) ) {
         return Double::NaN;
-    } else if( value == 0.0 || value == -0.0 ) {
+    } else if( !( value < 0 || value > 0 ) ) {
         return value;
     }
 
@@ -125,7 +125,7 @@
         return Double::NaN;
     } else if( Double::isInfinite( value ) ) {
         return value;
-    } else if( value == 0.0 || value == -0.0 ) {
+    } else if( !( value < 0 || value > 0 ) ) {
         return value;
     }
 
@@ -137,7 +137,7 @@
 
     if( Double::isNaN( value ) || value < -1.0 ) {
         return Double::NaN;
-    } else if( value == 0.0 || value == -0.0 ) {
+    } else if( !( value < 0 || value > 0 ) ) {
         return value;
     }
 
@@ -189,7 +189,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 double Math::exp( double value ) {
 
-    if( Double::isNaN( value ) || value < -1.0 ) {
+    if( Double::isNaN( value ) ) {
         return Double::NaN;
     } else if( value == Double::POSITIVE_INFINITY ) {
         return Double::POSITIVE_INFINITY;
@@ -316,7 +316,7 @@
         return Double::NaN;
     } else if( value == Double::POSITIVE_INFINITY ) {
         return Double::POSITIVE_INFINITY;
-    } else if( value == 0.0 || value == -0.0 ) {
+    } else if( !( value < 0 || value > 0 ) ) {
         return Double::NEGATIVE_INFINITY;
     }
 
@@ -346,7 +346,7 @@
         return Double::POSITIVE_INFINITY;
     } else if( value == -1.0 ) {
         return Double::NEGATIVE_INFINITY;
-    } else if( value == 0.0 || value == -0.0 ) {
+    } else if( !( value < 0 || value > 0 ) ) {
         return value;
     }
 
@@ -498,5 +498,5 @@
     }
 
     value = abs( value );
-    return ::nextafterf( value, Double::MAX_VALUE ) - value;
+    return ::nextafter( value, Double::MAX_VALUE ) - value;
 }