-
-
Notifications
You must be signed in to change notification settings - Fork 706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Issue 5628 - std.math unittest disabled - roundoff error in pow() #7321
Conversation
|
Thanks for your pull request and interest in making D better, @berni44! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + phobos#7321" |
|
WIP: The unittest failed on FreeBSD. i added some writelns to see, what happens... |
FYI: We only semi-officially support FreeBSD. For example, std.net.curl isn't supported at all anymore and with the upcoming FreeBSD 12 isn't supported either. So if there's no immediate fix/solution, I would suggest not to bother about FreeBSD (i.e. disable it for FreeBSD) and waste time into that sink, but into more interesting and impactful things ;-) |
|
Unfortunately win32 has the same bug. |
|
Not WIP anymore. I found a workaround with IMHO it's a bug in DMD and I filed a bugreport. We are discussing it there currently. |
|
I don't think the compiler is to blame here at all. The problem/surprising fact is that this templated
Absolutely. |
From the discussions in the bugreport I meanwhile know, that "intermediate results" is stretched far more on 32bit machines than I thought. The result type of |
|
This is green, is it good to go? |
|
IMHO yes |
The original tests compare apples and oranges, that is, left side double/float, right side real. The values on the left side are correct in the precision available but real has better precision and therefore the tests failed. Casting to the lower precision fixes this.
As a side note: I dislike these tests, because the right side could still produce wrong results, depending on the implementation of * and / and rounding errors. I'd prefere to compare to manually calculated literals.