-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new notes from 11.10.2024 and earlier
- Loading branch information
1 parent
cfaa533
commit 5de6025
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# How to apply binary operations to numbers as floats? | ||
To apply any binary operation (an operation, that needs 2 operands) to numbers as floats [[20241010165723]] do the following things: | ||
1. Normalize the number | ||
2. Bring the numbers to the same exponent (by shifting the larger number number to the right) (the new bits fill the guard, round and sticky bit [[20241014194612]]) | ||
3. Apply your operation to the mantissas of the numbers | ||
4. Apply the rules for the GRS bits to the result [[20241014195117]]. | ||
|
||
#gds #floatingpoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# What are the guard, round and sticky bits (GRS)? | ||
The guard, round and sticky bits are bits, that are appended to floating point numbers [[20241010165723]] in order to allow for maximum accuracy when applying operations. To be precise they have the function of ensuring, that an operation applied to rounded operands returns the same result as the rounded result of | ||
the operation with unrounded operands. | ||
|
||
#gds #floatingpoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# What are the rules for optimal rounding with the guard, round and sticky bit? | ||
The rules for optimal rounding of floating point numbers [[20241010165723]] using the guard, round and sticky [[20241014194612]] bit are described in the following table: | ||
|
||
| G | R | S | Mantissa | | ||
|---|---|---|----------------------------------| | ||
| 0 | x | x | Unchanged (round down) | | ||
| 1 | 1 | x | Result += 1 (round up) | | ||
| 1 | 0 | 0 | if lsb is 0 unchanged, else +=1 | | ||
| 1 | 0 | 1 | Result += 1 (round up) | | ||
|
||
#gds #floatingpoint |