-
assigned issue to
test_rational() fails
One of the unit tests in testdmath fails with HEAD version:
#!
.\testdmath.exe
src\tests\testdmath.cpp[70] Rational(HNumber("-1235000")/HNumber("78950000")).toString().toStdString() [NEW]
Result : -343/21927
Expected : -247/15790
38 total, 1 failed, 1 new
I lack of time to find out which commit added this regression.
Comments (6)
-
-
WOW...
This is just becoming weirder....
The constructor of
Rational
usesHMath::floor
. It literally comes down to this very line (hmath.cpp[979]
) again:if (HMath::abs(n - nearest_int) < HNumber("1e-70") * HMath::abs(n + nearest_int))
Hadrien changed the tolerance to 1e-70 again (for good measure). That is what breaks
Rational
! In fact, we seem to require some value smaller than the resolution of SC. If I set it to 1e-100 it's fine.I give up. I have literally not the slightest idea what's going on there.
-
reporter On a side note, reverting to
1e-1000
"fixes" this issue, which probably explains why the test failure didn't show up when we initially reviewed pull request #47. Still, that doesn't make sense. -
- changed status to resolved
Fixes issue
#616Also added some bits that should have been in commit b7b2fc6.
→ <<cset f3a379af3261>>
-
Exactly. That's what I'm going to push now.
-
repo owner - changed status to closed
- Log in to comment