Skip to content

Commit

Permalink
Add new notes from 11.10.2024 and earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
if-loop69420 committed Oct 14, 2024
1 parent cfaa533 commit 5de6025
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions notes/20241014194001.md
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
5 changes: 5 additions & 0 deletions notes/20241014194612.md
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
11 changes: 11 additions & 0 deletions notes/20241014195117.md
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

0 comments on commit 5de6025

Please sign in to comment.