Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11631

When are implicit floating-point promotions something to warn about?

$
0
0

My C++ compiler warns about implicit floating-point conversions, as in

some_long_double_value() > 1.0

While I understand that the double constant 1.0 is implicitly converted to a long double value for the sake of comparison, I don't see why this is something to warn about.

I understand that implicit floating-point conversion might be undesirable in some situations, such as, say, overload resolution. But I think for the sake of comparison this is completely harmless. Or am I missing something here, such as a border case or special hardware situations?


Viewing all articles
Browse latest Browse all 11631

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>