View | Details | Raw Unified | Return to issue 114430
Collapse All | Expand All

(-)sal/inc/rtl/math.h (+15 lines)
Lines 396-401 Link Here
396
 */
396
 */
397
double SAL_CALL rtl_math_pow10Exp(double fValue, int nExp) SAL_THROW_EXTERN_C();
397
double SAL_CALL rtl_math_pow10Exp(double fValue, int nExp) SAL_THROW_EXTERN_C();
398
398
399
/** Similar to pow() with stricter exception handling for indeterminate values.
400
401
    powr is part of the IEEE 754 2008 Floating Point Standard.
402
403
    @param fValue
404
    The value to be raised.
405
406
    @param fExp
407
    The exponent.
408
409
    @return
410
    powr(fValue, fExp)
411
 */
412
double SAL_CALL rtl_math_powr(double fValue, double fExp) SAL_THROW_EXTERN_C();
413
399
/** Rounds value to 15 significant decimal digits.
414
/** Rounds value to 15 significant decimal digits.
400
415
401
    @param fValue
416
    @param fValue
(-)sal/inc/rtl/math.hxx (+7 lines)
Lines 186-191 Link Here
186
    return rtl_math_pow10Exp(fValue, nExp);
186
    return rtl_math_pow10Exp(fValue, nExp);
187
}
187
}
188
188
189
/** A wrapper around rtl_math_powr.
190
 */
191
inline double powr(double fValue, int fExp)
192
{
193
    return rtl_math_powr(fValue, fExp);
194
}
195
189
/** A wrapper around rtl_math_approxValue.
196
/** A wrapper around rtl_math_approxValue.
190
 */
197
 */
191
inline double approxValue(double fValue)
198
inline double approxValue(double fValue)
(-)sal/rtl/source/math.cxx (+11 lines)
Lines 1113-1119 Link Here
1113
    return (fe-1.0) * fValue / log(fe);
1113
    return (fe-1.0) * fValue / log(fe);
1114
}
1114
}
1115
1115
1116
double SAL_CALL rtl_math_powr( double fValue,  double fExp ) SAL_THROW_EXTERN_C()
1117
{
1118
    if (fValue == 0.0  && fExp == 0.0)
1119
    {
1120
        double fResult;
1121
        ::rtl::math::setNan( &fResult );
1122
        return fResult;
1123
    }
1124
    return pow(fValue, fExp);
1125
}
1116
1126
1127
1117
double SAL_CALL rtl_math_log1p( double fValue ) SAL_THROW_EXTERN_C()
1128
double SAL_CALL rtl_math_log1p( double fValue ) SAL_THROW_EXTERN_C()
1118
{
1129
{
1119
    // Use volatile because a compiler may be too smart "optimizing" the
1130
    // Use volatile because a compiler may be too smart "optimizing" the
(-)sal/util/sal.map (+2 lines)
Lines 629-634 Link Here
629
    global:
629
    global:
630
        osl_loadAsciiModule;
630
        osl_loadAsciiModule;
631
        osl_loadAsciiModuleRelative;
631
        osl_loadAsciiModuleRelative;
632
633
        rtl_math_powr;
632
} UDK_3.11;
634
} UDK_3.11;
633
635
634
PRIVATE_1.0 {
636
PRIVATE_1.0 {
(-)sc/source/core/tool/interpr5.cxx (-3 / +3 lines)
Lines 1611-1624 Link Here
1611
            if (bFlag)
1611
            if (bFlag)
1612
            {   for ( SCSIZE i = 0; i < nCount; i++ )
1612
            {   for ( SCSIZE i = 0; i < nCount; i++ )
1613
                    if (pMat->IsValue(i))
1613
                    if (pMat->IsValue(i))
1614
                        pResMat->PutDouble(pow(fVal,pMat->GetDouble(i)), i);
1614
                        pResMat->PutDouble(::rtl::math::powr(fVal,pMat->GetDouble(i)), i);
1615
                    else
1615
                    else
1616
                        pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), i);
1616
                        pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), i);
1617
            }
1617
            }
1618
            else
1618
            else
1619
            {   for ( SCSIZE i = 0; i < nCount; i++ )
1619
            {   for ( SCSIZE i = 0; i < nCount; i++ )
1620
                    if (pMat->IsValue(i))
1620
                    if (pMat->IsValue(i))
1621
                        pResMat->PutDouble(pow(pMat->GetDouble(i),fVal), i);
1621
                        pResMat->PutDouble(::rtl::math::powr(pMat->GetDouble(i),fVal), i);
1622
                    else
1622
                    else
1623
                        pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), i);
1623
                        pResMat->PutString(ScGlobal::GetRscString(STR_NO_VALUE), i);
1624
            }
1624
            }
Lines 1628-1634 Link Here
1628
            PushIllegalArgument();
1628
            PushIllegalArgument();
1629
    }
1629
    }
1630
    else
1630
    else
1631
        PushDouble(pow(fVal1,fVal2));
1631
        PushDouble(::rtl::math::powr(fVal1,fVal2));
1632
}
1632
}
1633
1633
1634
void ScInterpreter::ScSumProduct()
1634
void ScInterpreter::ScSumProduct()

Return to issue 114430