Floating point constant folding bug?
Iain Buclaw
ibuclaw at ubuntu.com
Fri Mar 15 08:29:29 PDT 2013
On 15 March 2013 15:15, Johannes Pfau <nospam at example.com> wrote:
> writefln("%f\n%f", cast(float)cast(int)float.infinity, float.infinity);
>
> writes
> ---
> 2147483648.000000
> inf
> ---
>
> -fdump-tree-original
> ---
> writefln ({.length=5, .ptr="%f\n%f"}, 2.147483647e+9, Inf);
> ---
>
> The same conversion at runtime produces the expected result.
>
> Is this a gdc or gcc bug or is this expected?
>
GCC bug, try the same in C and see if it produces the same result.
--
Iain Buclaw
*(p < e ? p++ : p) = (c & 0x0f) + '0';
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20130315/06c946a8/attachment.html>
More information about the D.gnu
mailing list