File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -80,8 +80,8 @@ def round_float(
80
80
isignificand = math .floor (fsignificand )
81
81
delta = fsignificand - isignificand
82
82
if (
83
- (rnd == RoundMode .TowardPositive and not sign )
84
- or (rnd == RoundMode .TowardNegative and sign )
83
+ (rnd == RoundMode .TowardPositive and not sign and delta > 0 )
84
+ or (rnd == RoundMode .TowardNegative and sign and delta > 0 )
85
85
or (rnd == RoundMode .TiesToAway and delta >= 0.5 )
86
86
or (rnd == RoundMode .TiesToEven and delta > 0.5 )
87
87
or (rnd == RoundMode .TiesToEven and delta == 0.5 and _isodd (isignificand ))
@@ -108,6 +108,7 @@ def round_float(
108
108
else :
109
109
assert isignificand == 1
110
110
expval += 1
111
+ ## End special case for Precision=1.
111
112
112
113
result = isignificand * (2.0 ** expval )
113
114
You can’t perform that action at this time.
0 commit comments