Все интересные float
2022-08-03 12:29Соорудил список всех "интересных" чисел с плавающей точкой (32-битных). Вдруг кому пригодится.
floats.txt
Некоторые выдающиеся экземпляры:
floats.txt
Некоторые выдающиеся экземпляры:
Знак | Экспонента Мантисса 0 00000000 00000000000000000000000 = 0.0 1 00000000 00000000000000000000000 = -0.0 0 00000000 00000000000000000000001 = 1.40129846e-45 денормализованное 0 00000000 10000000000000000000000 = 5.87747175e-39 денормализованное 0 00000000 11111111111111111111111 = 1.17549421e-38 денормализованное 0 00000001 00000000000000000000000 = 1.17549435e-38 0 01111111 00000000000000000000000 = 1.0 0 01111111 00000000000000000000001 = 1.00000012 0 01111111 10000000000000000000000 = 1.5 0 01111111 11111111111111111111111 = 1.99999988 0 10000000 00000000000000000000000 = 2.0 0 10000000 00000000000000000000001 = 2.00000024 0 10000000 10000000000000000000000 = 3.0 0 10000000 11111111111111111111111 = 3.99999976 0 11111110 00000000000000000000000 = 1.70141183e+38 0 11111110 11111111111111111111111 = 3.40282347e+38 0 11111111 00000000000000000000000 = inf 1 11111111 00000000000000000000000 = -inf 0 11111111 00000000000000000000001 = nan 0 11111111 10000000000000000000000 = nan 0 11111111 11111111111111111111111 = nan

no subject
Date: 2022-08-04 03:58 (UTC)It can be required that the most significant digit of the significand of a non-zero number be non-zero (except when the corresponding exponent would be smaller than the minimum one). This process is called normalization. For binary formats (which uses only the digits 0 and 1), this non-zero digit is necessarily 1. Therefore, it does not need to be represented in memory; allowing the format to have one more bit of precision. This rule is variously called the leading bit convention, the implicit bit convention, the hidden bit convention, or the assumed bit convention.
https://en.wikipedia.org/wiki/Floating-point_arithmetic#Hidden_bit