std.math: Move pow function into submodule.#7942
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 referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + phobos#7942" |
|
Some windows computers fail with a unittest in Anyone an idea, what's the reason here? |
|
MS win has evaluate the failing assertion |
Aside from a few needed imports it's cut and paste... |
|
It's only one digit: .0...799 instead of .0...800. Anyway I wonder, why the calculation changed. It shouldn't. |
|
IMHO, we should find out, why dmd produces different code here and fix that... |
|
I wonder if might be possible that the compiler searches for pow in both druntime and std.math. Maybe these have different implementations and now since pow is moved from std.math, the compiler picks the one in druntime? Also, there's the style checker: |
I'm aware of that, but I see no merit in starting the testers again, when the main issue is not fixed... ;-) (Ideally, the gammafunction should not be touched at all.) |
|
Ok, I was just pointing that out :-" |
|
The compiler lowers Hazarding a guess, but you might need to force that the std version takes precedent with: In the package module. Ideally pow should really be in druntime though because it is doubles as a compiler-runtime interface, however the non-trivial template implementation makes it awkward to move without also privately copying a good chunk of meta and traits along with it. |
For |
No, unfortunately not... |
Another shot in the dark. Remove the public import of core.math from the std.math package. In its place, use public selective imports in the appropriate submodules. An intentional side effect being future core.math intrinsics won't be implicitly pulled into std.math. |
|
Oh, then I suppose it'll likely have no effect at all them, except if there're bugs in the import visibility system. |
Saying that though, it all seems to be green? |
Unfortunately not. Still the same problem. |
|
@berni44 - I've managed to find some time to check this proper. Compiling gammafunction.d on x86_64-linux using Looks like the culprit is that you forgot to define |
|
Just realised I can commit the suggestions myself. |
|
New error: Which is correct, when LDC/GDC is building DMD, the resultant compiler can not interpret yl2x at compile-time. |
|
So this is blocked by the compiler now. It looks only for module names ending with |
Wilsonator pointed me to the same line in PR #7943. |
Validating a fix just now with |
|
No longer blocked by compiler built-ins support. Looks like one remaining failure is due to missing symbols. |
ibuclaw
left a comment
There was a problem hiding this comment.
One last nit, and this is good to go.
|
Many thanks for your help! |
Moving pow to submodule seems to be a little bit more problematic, so I'm doing this in a single step. Let's see if it works...