db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r373569 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java testing/org/apache/derbyTesting/functionTests/master/functions.out testing/org/apache/derbyTesting/functionTests/tests/lang/functions.sql
Date Mon, 30 Jan 2006 19:09:02 GMT
Author: djd
Date: Mon Jan 30 11:08:54 2006
New Revision: 373569

URL: http://svn.apache.org/viewcvs?rev=373569&view=rev
Log:
DERBY-475 Switch the new maths functions to use java.lang.StrictMath to ensure
consistent results across Java Virtual Machines. Added a natual log function
LOG which is identical to LN() but will aid DERBY-592, adding a match for 
the escaped function {fn log(value)}

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/functions.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/functions.sql

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?rev=373569&r1=373568&r2=373569&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
Mon Jan 30 11:08:54 2006
@@ -201,19 +201,20 @@
 	*
 	*/
 	private static final String[][] SYSFUN_FUNCTIONS = {
-			{"ACOS", "DOUBLE", "java.lang.Math", "acos(double)", "DOUBLE"},
-			{"ASIN", "DOUBLE", "java.lang.Math", "asin(double)", "DOUBLE"},
-			{"ATAN", "DOUBLE", "java.lang.Math", "atan(double)", "DOUBLE"},
-			{"COS", "DOUBLE", "java.lang.Math", "cos(double)", "DOUBLE"},
-			{"SIN", "DOUBLE", "java.lang.Math", "sin(double)", "DOUBLE"},
-			{"TAN", "DOUBLE", "java.lang.Math", "tan(double)", "DOUBLE"},
-			{"DEGREES", "DOUBLE", "java.lang.Math", "toDegrees(double)", "DOUBLE"},
-			{"RADIANS", "DOUBLE", "java.lang.Math", "toRadians(double)", "DOUBLE"},
-			{"LN", "DOUBLE", "java.lang.Math", "log(double)", "DOUBLE"},
-			{"EXP", "DOUBLE", "java.lang.Math", "exp(double)", "DOUBLE"},
-			{"CEIL", "DOUBLE", "java.lang.Math", "ceil(double)", "DOUBLE"},
-			{"CEILING", "DOUBLE", "java.lang.Math", "ceil(double)", "DOUBLE"},
-			{"FLOOR", "DOUBLE", "java.lang.Math", "floor(double)", "DOUBLE"},			
+			{"ACOS", "DOUBLE", "java.lang.StrictMath", "acos(double)", "DOUBLE"},
+			{"ASIN", "DOUBLE", "java.lang.StrictMath", "asin(double)", "DOUBLE"},
+			{"ATAN", "DOUBLE", "java.lang.StrictMath", "atan(double)", "DOUBLE"},
+			{"COS", "DOUBLE", "java.lang.StrictMath", "cos(double)", "DOUBLE"},
+			{"SIN", "DOUBLE", "java.lang.StrictMath", "sin(double)", "DOUBLE"},
+			{"TAN", "DOUBLE", "java.lang.StrictMath", "tan(double)", "DOUBLE"},
+			{"DEGREES", "DOUBLE", "java.lang.StrictMath", "toDegrees(double)", "DOUBLE"},
+			{"RADIANS", "DOUBLE", "java.lang.StrictMath", "toRadians(double)", "DOUBLE"},
+			{"LN", "DOUBLE", "java.lang.StrictMath", "log(double)", "DOUBLE"},
+			{"LOG", "DOUBLE", "java.lang.StrictMath", "log(double)", "DOUBLE"}, // Same as LN
+			{"EXP", "DOUBLE", "java.lang.StrictMath", "exp(double)", "DOUBLE"},
+			{"CEIL", "DOUBLE", "java.lang.StrictMath", "ceil(double)", "DOUBLE"},
+			{"CEILING", "DOUBLE", "java.lang.StrictMath", "ceil(double)", "DOUBLE"}, // Same as CEIL
+			{"FLOOR", "DOUBLE", "java.lang.StrictMath", "floor(double)", "DOUBLE"},			
 	};
 	
 	/**

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/functions.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/functions.out?rev=373569&r1=373568&r2=373569&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/functions.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/functions.out
Mon Jan 30 11:08:54 2006
@@ -631,12 +631,14 @@
 NULL     
 0.011    
 0.023    
-ij> select cast (LN(d) as DECIMAL(6,3)) AS LN FROM SYSFUN_MATH_TEST;
-LN       
----------
-NULL     
--0.400   
-0.292    
+ij> select cast (LN(d) as DECIMAL(6,3)) AS LN,
+       cast (LOG(d) as DECIMAL(6,3)) AS LOG
+                       FROM SYSFUN_MATH_TEST;
+LN       |LOG      
+-------------------
+NULL     |NULL     
+-0.400   |-0.400   
+0.292    |0.292    
 ij> select cast (EXP(d) as DECIMAL(6,3)) AS EXP FROM SYSFUN_MATH_TEST;
 EXP      
 ---------

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/functions.sql
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/functions.sql?rev=373569&r1=373568&r2=373569&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/functions.sql
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/functions.sql
Mon Jan 30 11:08:54 2006
@@ -285,7 +285,9 @@
 select cast (DEGREES(d) as DECIMAL(6,3)) AS DEGREES FROM SYSFUN_MATH_TEST;
 select cast (RADIANS(d) as DECIMAL(6,3)) AS RADIANS FROM SYSFUN_MATH_TEST;
 
-select cast (LN(d) as DECIMAL(6,3)) AS LN FROM SYSFUN_MATH_TEST;
+select cast (LN(d) as DECIMAL(6,3)) AS LN,
+       cast (LOG(d) as DECIMAL(6,3)) AS LOG
+                       FROM SYSFUN_MATH_TEST;
 select cast (EXP(d) as DECIMAL(6,3)) AS EXP FROM SYSFUN_MATH_TEST;
 
 select cast (CEIL(d) as DECIMAL(6,3)) AS CEIL FROM SYSFUN_MATH_TEST;



Mime
View raw message