Floating point constant folding

Fool via Digitalmars-d digitalmars-d at puremagic.com
Fri Mar 3 15:43:52 PST 2017


On Friday, 3 March 2017 at 22:35:15 UTC, Johan Engelen wrote:
> Clang without/with optimizations turned on:
> ❯ clang++ float.cpp && ./a.out
> 1.00000011920928955078125
>
> ❯ clang++ float.cpp -O3 && ./a.out
> 1
>
> -Johan

GCC with optimizations turned on:
$ g++ float.cpp -O3 -frounding-math && ./a.out
1.00000011920928955078125


More information about the Digitalmars-d mailing list