cpp_weekly icon indicating copy to clipboard operation
cpp_weekly copied to clipboard

Floating point precisions and `std::numeric_limits` digits, exponents, min/lowest members.

Open abhi-k9 opened this issue 1 year ago • 1 comments

Channel

"C++Weekly" request.

Topics

  1. Floating point precision
  2. std::numeric_limits<T>::digits, std::numeric_limits<T>::digits10, std::numeric_limits<T>::max_digits10 differences.
  3. std::numeric_limits<T>::min, std::numeric_limits<T>::lowest differences.
  4. std::numeric_limits<T>::min_exponent, std::numeric_limits<T>::min_exponent10, std::numeric_limits<T>::max_exponent, std::numeric_limits<T>::max_exponent10 differences if time permits.

Length

Long form if need be, but could possibly be a short one.

abhi-k9 avatar Oct 20 '24 22:10 abhi-k9

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).

Dharmesh946 avatar Oct 31 '24 08:10 Dharmesh946