IEEE 754
An IEEE standard for binary floating-point arithmetic that defines the representation of floating-point numbers, precision levels (approximately 7 decimal significant digits for fp32 and 15 for fp64), and rounding rules. It serves as the foundational specification for floating-point operations in modern computing.
Timeline (last 90 days)
NaN in the IEEE 754 floating-point standard represents an invalid operation result, with common triggering conditions including 0/0, ∞−∞, ∞×0, and taking the square root of a negative number.
IEEE 754 double-precision floating-point numbers (TypeScript's number type) cannot precisely represent many decimal fractions, and are therefore unsuitable for financial calculations.
IEEE 754 double-precision floating point (float64) can only exactly represent fractions whose denominator is a power of 2, and decimal fractions like 0.1 and 0.2 are infinite repeating fractions in binary, so they are necessarily truncated when stored.
IEEE 754 floating-point numbers cannot precisely represent most decimal fractions, and repeated operations produce rounding errors, for example in JavaScript 0.1 + 0.2 === 0.30000000000000004.
After converting an unsigned integer n to float, the exponent field of the normalized result equals floor(log2(n)) + 127.
In the floating-point exponent extraction method, a zero-value input produces -∞ (all-zero exponent), which requires additional handling.
For 32-bit integers exceeding 2²⁴, the mantissa precision of single-precision floating-point is insufficient to represent the value exactly, causing the exponent field to be underestimated.
Single-precision floating-point numbers store the exponent in 8 bits using biased encoding with bias = 127.
Floating-point addition does not satisfy the associative law; (a+b)+c and a+(b+c) may differ by one unit in the last place.
Floating-point addition and multiplication are not associative under the IEEE 754 standard, and the different internal summation orders of GEMM and GEMV produce extremely small differences in activation values for the same input.
8 more timeline events
All Facts (19)
Python的浮点数遵循IEEE 754双精度浮点数标准,使用64位二进制来表示一个小数
60%UnverifiedNaN in the IEEE 754 floating-point standard represents an invalid operation result, with common triggering conditions including 0/0, ∞−∞, ∞×0, and taking the square root of a negative number.
50%UnverifiedIEEE 754 double-precision floating-point numbers (TypeScript's number type) cannot precisely represent many decimal fractions, and are therefore unsuitable for financial calculations.
50%UnverifiedIEEE 754 double-precision floating point (float64) can only exactly represent fractions whose denominator is a power of 2, and decimal fractions like 0.1 and 0.2 are infinite repeating fractions in binary, so they are necessarily truncated when stored.
50%UnverifiedIEEE 754 floating-point numbers cannot precisely represent most decimal fractions, and repeated operations produce rounding errors, for example in JavaScript 0.1 + 0.2 === 0.30000000000000004.
50%UnverifiedIn the floating-point exponent extraction method, a zero-value input produces -∞ (all-zero exponent), which requires additional handling.
50%UnverifiedSingle-precision floating-point numbers store the exponent in 8 bits using biased encoding with bias = 127.
50%UnverifiedAfter converting an unsigned integer n to float, the exponent field of the normalized result equals floor(log2(n)) + 127.
50%UnverifiedFor 32-bit integers exceeding 2²⁴, the mantissa precision of single-precision floating-point is insufficient to represent the value exactly, causing the exponent field to be underestimated.
50%UnverifiedFloating-point addition does not satisfy the associative law; (a+b)+c and a+(b+c) may differ by one unit in the last place.
50%UnverifiedFloating-point addition and multiplication are not associative under the IEEE 754 standard, and the different internal summation orders of GEMM and GEMV produce extremely small differences in activation values for the same input.
50%UnverifiedJavaScript's native Date object is essentially an IEEE 754 double-precision floating-point number representing milliseconds since the Unix epoch, directly depending on the underlying operating system clock.
50%UnverifiedJavaScript's native number type is an IEEE 754 double-precision float whose 53-bit mantissa loses precision when representing nanosecond-level timestamps (on the order of approximately 1.7×10¹⁸), which is the fundamental reason for recommending BigInt instead.
50%UnverifiedThe SSE2 instruction set was introduced in 2001 with the Pentium 4, bringing IEEE 754-compliant 32/64-bit floating-point operations.
50%UnverifiedFP32 uses 32 bits to represent floating-point numbers, consisting of 1 sign bit, 8 exponent bits, and 23 mantissa bits.
50%UnverifiedAccording to IEEE 754's round-to-nearest-even rounding rule, adding a number less than half a ULP (approximately 0.00000006) to 1.0 still results in 1.0, making the addition ineffective.
50%UnverifiedHexel Editor provides instant decoding of the byte at the cursor position, displaying how the data is interpreted under different data types (8/16/32/64-bit integers, IEEE 754 floating-point numbers, ASCII/UTF-8 character encoding, etc.).
50%UnverifiedThe actual result of the floating-point operation 0.1 + 0.2 is 0.30000000000000004, not the exact value 0.3.
50%UnverifiedDue to IEEE 754 floating-point precision limitations, directly using EXPECT_EQ for floating-point comparisons will almost certainly lead to false failures, and EXPECT_NEAR should be used to specify a tolerance.
50%