Re: FP magic in std.math.pow

2016-08-01 Thread Seb via Digitalmars-d-learn
On Sunday, 31 July 2016 at 22:45:16 UTC, Stefan Koch wrote: 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

Re: FP magic in std.math.pow

2016-07-31 Thread Stefan Koch via Digitalmars-d-learn
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

FP magic in std.math.pow

2016-07-31 Thread Seb via Digitalmars-d-learn
Consider this short program: void main() { alias S = float; S s1 = 0x1.24c92ep+5; S s2 = -0x1.1c71c8p+0; import std.math : std_pow = pow; import core.stdc.stdio : printf; import core.stdc.math: powf; printf("std: %a\n", std_pow(s1, s2)); printf("pow: %a\n", s1