FP magic in std.math.pow

Stefan Koch via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jul 31 15:45:16 PDT 2016


On Sunday, 31 July 2016 at 22:38:59 UTC, Seb wrote:
> Consider this short program:
>
> void main()
> {
>     alias S = float;
>     S s1 = 0x1.24c92ep+5;
>     S s2 = -0x1.1c71c8p+0;
>
> [...]

It's an anoying feature.
The reason this is not implemented in dmd is that pow does not 
map to a simple cpu instruction on x86.

I will have another shot at fixing this once the CTFE stuff is in.


More information about the Digitalmars-d-learn mailing list