User Tools

Site Tools


tanszek:oktatas:techcomm:floating-point_representation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tanszek:oktatas:techcomm:floating-point_representation [2024/10/06 17:27] – created kneheztanszek:oktatas:techcomm:floating-point_representation [2024/10/06 17:35] (current) – [The IEEE 754 Standard] knehez
Line 13: Line 13:
 The formula: The formula:
  
-$$ \text{Value} = (-1)^S \times 1.M \times 2^{(E - \text{Bias})} $$+$$ \text{value} = (-1)^S \times 1.M \times 2^{(E - \text{Bias})} $$
  
 where **Bias** is 127 for single-precision (32-bit). where **Bias** is 127 for single-precision (32-bit).
Line 36: Line 36:
   * **Step 4**: Combine them   * **Step 4**: Combine them
 $$ 0 | 10000010 | 01001000000000000000000 $$ $$ 0 | 10000010 | 01001000000000000000000 $$
 +
 +==== Special Values in Floating-Point Representation ====
 +
 +In the IEEE 754 floating-point standard, certain special values are reserved for //edge cases// such as **zero**, **infinity**, and **undefined operations**. These values help systems represent situations that can’t be expressed as regular floating-point numbers.
 +
 +=== Special Values Overview ===
 +
 +  * **Zero**: Represents positive or negative zero
 +  * **Infinity**: Represents positive or negative infinity, resulting from overflow or division by zero.
 +  * **NaN (Not a Number)**: Represents undefined results, such as **0/0** or **sqrt(-1)**
 +
 +^ Value ^ Sign Bit (S) ^ Exponent (E) ^ Mantissa (M) ^ Description ^ 
 +| +Zero | 0 | 00000000 | 00000000000000000000000 | Represents positive zero | 
 +| -Zero | 1 | 00000000 | 00000000000000000000000 | Represents negative zero | 
 +| +Infinity| 0 | 11111111 | 00000000000000000000000 | Represents positive infinity | 
 +| -Infinity| 1 | 11111111 | 00000000000000000000000 | Represents negative infinity | 
 +| NaN | 0 or 1 | 11111111 | Non-zero value | Represents "Not a Number", used for undefined operations |
 +
 +Try them out here: https://www.h-schmidt.net/FloatConverter/IEEE754.html
 +
tanszek/oktatas/techcomm/floating-point_representation.1728235657.txt.gz · Last modified: 2024/10/06 17:27 by knehez