This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/47146] Floating point to integer conversions
- From: "schwab at linux-m68k dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 3 Jan 2011 17:40:35 +0000
- Subject: [Bug c/47146] Floating point to integer conversions
- Auto-submitted: auto-generated
- References: <bug-47146-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47146
--- Comment #4 from Andreas Schwab <schwab@linux-m68k.org> 2011-01-03 17:40:24 UTC ---
> fprintf( stdout, "Float 100.0 * 0.3894949=%d\n", 100.0 * elapsed );
> fprintf( stdout, "Float 100 * 0.3894949=%d\n", 100 * elapsed );
>
> both produce the value '-536870912'.
Undefined behaviour: you pass a double value to a format that expects a value
of type int.