[Bug c++/57034] ternary operator with float infinity in O0

2013-04-23 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57034 --- Comment #7 from Jakub Jelinek 2013-04-23 17:42:25 UTC --- GCC bugzilla is a bug reporting mechanism, not a C++ discussion forum, so better follow-up elsewhere. That said, yes, if qFuture isn't negative and is smaller than INT_MAX conv

[Bug c++/57034] ternary operator with float infinity in O0

2013-04-23 Thread christopher.hite at jpmorgan dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57034 --- Comment #6 from Christopher Hite 2013-04-23 17:26:26 UTC --- Good, I was a big worried I couldn't convert ints to floats unless the int was safely mappable. It rounds which is what I'd expect. I now think z5 is safe, since int32_t(f

[Bug c++/57034] ternary operator with float infinity in O0

2013-04-23 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57034 --- Comment #5 from Jakub Jelinek 2013-04-23 11:59:35 UTC --- Guess you should read something about floating point. 0x7fff of course can't be represented exactly in IEEE 754 single precision format, so when you convert 2147483647 to fl

[Bug c++/57034] ternary operator with float infinity in O0

2013-04-23 Thread christopher.hite at jpmorgan dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57034 --- Comment #4 from Christopher Hite 2013-04-23 11:35:25 UTC --- 64-bit. Thanks for pointing out I was converting to float and back. Both of the following work: int32_t z3=(qFuture >= double(MAX) ? MAX : double(qFuture) ); //works

[Bug c++/57034] ternary operator with float infinity in O0

2013-04-22 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57034 Jakub Jelinek changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC|

[Bug c++/57034] ternary operator with float infinity in O0

2013-04-22 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57034 --- Comment #2 from Andrew Pinski 2013-04-22 18:20:45 UTC --- Is this on i686 (32bit)?

[Bug c++/57034] ternary operator with float infinity in O0

2013-04-22 Thread christopher.hite at jpmorgan dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57034 --- Comment #1 from Christopher Hite 2013-04-22 17:36:52 UTC --- Created attachment 29915 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29915 unit test of bug + build instructions in comment