ooo-build r11830 - in trunk: . patches/src680



Author: kyoshida
Date: Thu Mar  6 18:06:09 2008
New Revision: 11830
URL: http://svn.gnome.org/viewvc/ooo-build?rev=11830&view=rev

Log:
2008-03-06  Kohei Yoshida  <kyoshida novell com>

	* patches/src680/sc-formula-int-reduce-precision.diff: added to reduce
	precision to single-precision before flooring the value.  This minimizes
	the surprises caused by the binary floating-point rounding error; 
	i#86775, n#310706.

	* patches/src680/apply: apply the new patch.


Added:
   trunk/patches/src680/sc-formula-int-reduce-precision.diff
Modified:
   trunk/ChangeLog
   trunk/patches/src680/apply

Modified: trunk/patches/src680/apply
==============================================================================
--- trunk/patches/src680/apply	(original)
+++ trunk/patches/src680/apply	Thu Mar  6 18:06:09 2008
@@ -804,6 +804,9 @@
 # contributed from Lv Yue) (ODFF).
 sc-openformula-minmax.diff, i#38759, kohei
 
+# Reduce the precision to single-precision before flooring the value.
+sc-formula-int-reduce-precision.diff, n#310706, kohei
+
 # Support print & page preview for files containing only lines
 sc-print-lines.diff, n#351468, i#85076, jonp
 

Added: trunk/patches/src680/sc-formula-int-reduce-precision.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/sc-formula-int-reduce-precision.diff	Thu Mar  6 18:06:09 2008
@@ -0,0 +1,14 @@
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/core/tool/interpr2.cxx sc/source/core/tool/interpr2.cxx
+--- sc.clean/source/core/tool/interpr2.cxx	2008-03-03 11:24:50.000000000 -0500
++++ sc/source/core/tool/interpr2.cxx	2008-03-06 12:11:04.000000000 -0500
+@@ -419,7 +419,9 @@ void ScInterpreter::ScAbs()
+ 
+ void ScInterpreter::ScInt()
+ {
+-	PushDouble(::rtl::math::approxFloor(GetDouble()));
++    // extra precision in double sometimes causes the "wrong" calculation result.
++    float nVal = static_cast<float>(GetDouble());
++    PushDouble(::rtl::math::approxFloor(static_cast<double>(nVal)));
+ }
+ 
+ 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]