SyntaxFix
Write A Post
Hire A Developer
Questions
Floating point numbers (IEEE 754) are symmetrical, so if you can represent the greatest value (DBL_MAX or numeric_limits<double>::max()), just prepend a minus sign.
DBL_MAX
numeric_limits<double>::max()
And then is the cool way:
double f; (*((long long*)&f))= ~(1LL<<52);