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

In C++, what is the standard behaviour of static_cast(some_double_variable)?

$
0
0

Besides a loss of precision, there must also be some kind of special conversion behaviour that takes place when a double is cast as a float (e.g. clamping, etc). I have tried to find the C++ standard document(s), and the source code of the g++ compiler on Linux, but I have had no luck. I notice that the casting behaviour is identical on Windows as it is on Linux; the app gives the same results on both operating systems.

Any insight would be greatly appreciated. Thanks for your time.

I tried to do manual clamping, but I did not get the result that I'm looking for.


Viewing all articles
Browse latest Browse all 16330

Latest Images

Trending Articles



Latest Images

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