We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aea875d commit b2dfb94Copy full SHA for b2dfb94
src/gfloat/round.py
@@ -86,8 +86,8 @@ def round_float(
86
isignificand += 1
87
88
## Special case for Precision=1, all-log format with zero.
89
+ # The logic is simply duplicated (and isignificand overwritten) for clarity.
90
if fi.precision == 1:
- # The logic is simply duplicated for clarity of reading.
91
isignificand = math.floor(fsignificand)
92
code_is_odd = isignificand != 0 and _isodd(expval + bias)
93
if (
@@ -105,8 +105,9 @@ def round_float(
105
else:
106
assert isignificand == 1
107
expval += 1
108
- ## End special case for Precision=1.
+ ## End special case for Precision=1.
109
110
+ # Reconstruct rounded result to float
111
result = isignificand * (2.0**expval)
112
113
if result == 0:
0 commit comments