KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am writing a piece of code in which i have to convert from double to float values. I am using boost::numeric_cast to do this conversion which will alert me of any overflow/underflow. However i am also interested in knowing if that conversion resulted in some precision loss or not. For example double source = 1988.1012; float dest = numeric_cast<float>(source); Produces dest which has value 1988.1 Is there any way available in which i can detect this kind of precision loss/rounding
Tags (comma-separated)
Save Edits
Cancel