Remove duplicate builtins from std.math#8926
Conversation
|
Thanks for your pull request and interest in making D better, @Geod24! 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 fetch digger
dub run digger -- build "master + dmd#8926" |
|
Thats nice but I want to eventually move away from mangles for builtins/intrinsics, see e.g. #8002 |
The offending line: int signbit(X)(X x) @nogc @trusted pure nothrow
{
alias F = floatTraits!(X);
return ((cast(ubyte *)&x)[F.SIGNPOS_BYTE] & 0x80) != 0; // <<<<
}seems to be the only error though. |
A few years ago, we started moving builtins from Phobos to druntime, as it is where the compiler dependencies should live. This was never completed, and some dependencies still live in Phobos, while other definitions are missing from `core.math` (e.g. unimplemented builtins are not defined). While completing this will take time, a trivial first step is to remove the functions that just forwards to the builtins.
|
Yep it's
Ah, good to know! I see both PRs as complementary, as I'm just trying to reduce the duplication and increase consistency. |
Note: I counted the builtins, and there are 65 after the removal (and not 68).
Now for the sake of the reviewers:
std.math.sinstd.math.cosstd.math.sqrtstd.math.fabsstd.math.yl2xandstd.math.yl2xp1are not even definedstd.math.rndtolstd.math.ldexp