source: build-files/ports-overlay/editors/openoffice-devel/files/patch-i114430 @ d9f825f

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1releng/10.1.1releng/10.1.2
Last change on this file since d9f825f was d9f825f, checked in by Kris Moore <kris@…>, 19 months ago

Mark openoffice-devel as broken, don't need to keep wasting 4-5 hours
compiling it

  • Property mode set to 100644
File size: 3.5 KB
Line 
1Index: sal/inc/rtl/math.h
2===================================================================
3--- sal/inc/rtl/math.h  (revision 1447988)
4+++ sal/inc/rtl/math.h  (working copy)
5@@ -396,6 +396,21 @@
6  */
7 double SAL_CALL rtl_math_pow10Exp(double fValue, int nExp) SAL_THROW_EXTERN_C();
8 
9+/** Similar to pow() with stricter exception handling for indeterminate values.
10+
11+    powr is specified in the IEEE 754 - 2008 Floating Point Standard.
12+
13+    @param fValue
14+    The value to be raised.
15+
16+    @param fExp
17+    The exponent.
18+
19+    @return
20+    powr(fValue, fExp)
21+ */
22+double SAL_CALL rtl_math_powr(double fValue, double fExp) SAL_THROW_EXTERN_C();
23+
24 /** Rounds value to 15 significant decimal digits.
25 
26     @param fValue
27Index: sal/inc/rtl/math.hxx
28===================================================================
29--- sal/inc/rtl/math.hxx        (revision 1447988)
30+++ sal/inc/rtl/math.hxx        (working copy)
31@@ -186,6 +186,13 @@
32     return rtl_math_pow10Exp(fValue, nExp);
33 }
34 
35+/** A wrapper around rtl_math_powr.
36+ */
37+inline double powr(double fValue, double fExp)
38+{
39+    return rtl_math_powr(fValue, fExp);
40+}
41+
42 /** A wrapper around rtl_math_approxValue.
43  */
44 inline double approxValue(double fValue)
45Index: sal/rtl/source/math.cxx
46===================================================================
47--- sal/rtl/source/math.cxx     (revision 1447988)
48+++ sal/rtl/source/math.cxx     (working copy)
49@@ -1113,7 +1113,20 @@
50     return (fe-1.0) * fValue / log(fe);
51 }
52 
53+double SAL_CALL rtl_math_powr( double fValue,  double fExp ) SAL_THROW_EXTERN_C()
54+{
55+    if ((fValue == 0.0  && fExp == 0.0) ||
56+       (rtl::math::isInf( fExp ) && !rtl::math::isSignBitSet( fExp )) ||
57+       (rtl::math::isInf( fValue ) && !rtl::math::isSignBitSet( fValue )))
58+    {
59+        double fResult;
60+        ::rtl::math::setNan( &fResult );
61+        return fResult;
62+    }
63+    return pow(fValue, fExp);
64+}
65 
66+
67 double SAL_CALL rtl_math_log1p( double fValue ) SAL_THROW_EXTERN_C()
68 {
69     // Use volatile because a compiler may be too smart "optimizing" the
70Index: sal/util/sal.map
71===================================================================
72--- sal/util/sal.map    (revision 1447988)
73+++ sal/util/sal.map    (working copy)
74@@ -629,6 +629,8 @@
75     global:
76         osl_loadAsciiModule;
77         osl_loadAsciiModuleRelative;
78+
79+        rtl_math_powr;
80 } UDK_3.11;
81 
82 PRIVATE_1.0 {
83Index: sc/source/core/tool/interpr5.cxx
84===================================================================
85--- sc/source/core/tool/interpr5.cxx    (revision 1447988)
86+++ sc/source/core/tool/interpr5.cxx    (working copy)
87@@ -1611,14 +1611,14 @@
88             if (bFlag)
89             {   for ( SCSIZE i = 0; i < nCount; i++ )
90                     if (pMat->IsValue(i))
91-                        pResMat->PutDouble(pow(fVal,pMat->GetDouble(i)), i);
92+                        pResMat->PutDouble(::rtl::math::powr(fVal,pMat->GetDouble(i)), i);
93                     else
94                         pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), i);
95             }
96             else
97             {   for ( SCSIZE i = 0; i < nCount; i++ )
98                     if (pMat->IsValue(i))
99-                        pResMat->PutDouble(pow(pMat->GetDouble(i),fVal), i);
100+                        pResMat->PutDouble(::rtl::math::powr(pMat->GetDouble(i),fVal), i);
101                     else
102                         pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), i);
103             }
104@@ -1628,7 +1628,7 @@
105             PushIllegalArgument();
106     }
107     else
108-        PushDouble(pow(fVal1,fVal2));
109+        PushDouble(::rtl::math::powr(fVal1,fVal2));
110 }
111 
112 void ScInterpreter::ScSumProduct()
Note: See TracBrowser for help on using the repository browser.