Reputation: 391
I'm not aware and cannot quicly find the right way to enter floating point constant in C++.
If i want 2^-52, what should i write ? And, what does << with float ? Is that correct ?
const double pres = 1>>52
Upvotes: 1
Views: 871
Reputation: 23324
Looks like you really want the precision of double
representation. In this case, don't use magic constants. Instead you can use this:
const double pres = std::numeric_limits<double>::epsilon();
Upvotes: 5