[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kspread/functions
From:       Ariya Hidayat <ariya () kde ! org>
Date:       2007-01-07 5:14:45
Message-ID: 1168146885.706551.25845.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 620715 by ariya:

now CEILING(0; 0) gives correct result


 M  +5 -0      math.cpp  


--- trunk/koffice/kspread/functions/math.cpp #620714:620715
@@ -371,6 +371,11 @@
     res = args[1];
   else
     res = calc->gequal (number, Value(0.0)) ? Value(1.0) : Value(-1.0);
+    
+  // short-circuit, and allow CEILING(0;0) to give 0 (which is correct)
+  // instead of DIV0 error  
+  if(calc->isZero(number))
+    return Value(0.0);  
 
   if (calc->isZero(res))
     return Value::errorDIV0();
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic