[Issue 17662] New: Replace 2.0^e2 with std.math.ldexp(1.0, cast(int) e2)
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Jul 17 18:38:24 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=17662
Issue ID: 17662
Summary: Replace 2.0^e2 with std.math.ldexp(1.0, cast(int) e2)
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: performance
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: greensunny12 at gmail.com
See also: https://github.com/dlang/phobos/pull/5057
> It should be clear that just setting the exponent (some integer ops) is way faster than the current loop for bigger absolute N, but I didn't perform any speed tests.
I'd rather drop this and add the optimization to the compiler, something like
[1]
[1]
https://github.com/kinke/ldc/commit/dc01a338d73c2cdb843de6426f520f6c175640d3
--
More information about the Digitalmars-d-bugs
mailing list