cpp_weekly
cpp_weekly copied to clipboard
Floating point precisions and `std::numeric_limits` digits, exponents, min/lowest members.
Channel
"C++Weekly" request.
Topics
- Floating point precision
-
std::numeric_limits<T>::digits,std::numeric_limits<T>::digits10,std::numeric_limits<T>::max_digits10differences. -
std::numeric_limits<T>::min,std::numeric_limits<T>::lowestdifferences. -
std::numeric_limits<T>::min_exponent,std::numeric_limits<T>::min_exponent10,std::numeric_limits<T>::max_exponent,std::numeric_limits<T>::max_exponent10differences if time permits.
Length
Long form if need be, but could possibly be a short one.
NB floating point accuracy is not limited to these types but also to the kind of operations performed, floating point promotion and the underlying HW implementation of the types (typically, it can have 80 bits for intermediate computation, which can lead to unexpected behaviors).