Skip to content

Commit

Permalink
Address PR Comment
Browse files Browse the repository at this point in the history
  • Loading branch information
awf committed Jun 6, 2024
1 parent aea875d commit b2dfb94
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gfloat/round.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def round_float(
isignificand += 1

## Special case for Precision=1, all-log format with zero.
# The logic is simply duplicated (and isignificand overwritten) for clarity.
if fi.precision == 1:
# The logic is simply duplicated for clarity of reading.
isignificand = math.floor(fsignificand)
code_is_odd = isignificand != 0 and _isodd(expval + bias)
if (
Expand All @@ -105,8 +105,9 @@ def round_float(
else:
assert isignificand == 1
expval += 1
## End special case for Precision=1.
## End special case for Precision=1.

# Reconstruct rounded result to float
result = isignificand * (2.0**expval)

if result == 0:
Expand Down

0 comments on commit b2dfb94

Please sign in to comment.