Skip to content

Commit ed7810c

Browse files
committed
spotbugs fixes
1 parent a4d6281 commit ed7810c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/util/NumericSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static short floatToShortBits(PNodeWithRaise nodeWithRaise, double value) {
154154
assert bits < 1024;
155155
assert e < 31;
156156

157-
if ((f - bits > 0.5) || ((f - bits == 0.5) && ((bits % 2) == 1))) {
157+
if ((f - bits > 0.5) || (equalsApprox(f - bits, 0.5) && ((bits & 1) != 0))) {
158158
++bits;
159159
if (bits == 1024) {
160160
// The carry propagated out of a string of 10 1 bits.

0 commit comments

Comments
 (0)