Kaydet (Commit) fa293f7d authored tarafından Caolán McNamara's avatar Caolán McNamara

use div() instead of /0 to content ubsan

for the same reason as...

commit fb2c1467
Author: Eike Rathke <erack@redhat.com>
Date:   Mon Jul 25 13:32:17 2016 +0200

    use div() instead of /0 to content ubsan

    While we do handle double floating point division by 0 at least on
    IEEE754 systems, ubsan builds mock about.

Change-Id: I2c96b63a4af3cb2e8483a1d0f2da91ea82da227c
üst 77327759
......@@ -1872,11 +1872,11 @@ double ScInterpreter::ScGetRmz(double fRate, double fNper, double fPv,
else
{
if (bPayInAdvance) // payment in advance
fPayment = (fFv + fPv * exp( fNper * ::rtl::math::log1p(fRate) ) ) * fRate /
(::rtl::math::expm1( (fNper + 1) * ::rtl::math::log1p(fRate) ) - fRate);
fPayment = div((fFv + fPv * exp( fNper * ::rtl::math::log1p(fRate) ) ) * fRate,
(::rtl::math::expm1( (fNper + 1) * ::rtl::math::log1p(fRate) ) - fRate));
else // payment in arrear
fPayment = (fFv + fPv * exp(fNper * ::rtl::math::log1p(fRate) ) ) * fRate /
::rtl::math::expm1( fNper * ::rtl::math::log1p(fRate) );
fPayment = div((fFv + fPv * exp(fNper * ::rtl::math::log1p(fRate) ) ) * fRate,
::rtl::math::expm1( fNper * ::rtl::math::log1p(fRate) ));
}
return -fPayment;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment