Skip to content

Commit 233e52d

Browse files
committed
float conversion from rbigint may overflow (FloatTest in #131)
1 parent 3728cb5 commit 233e52d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rsqueakvm/model/numeric.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@ def unwrap_long_untranslated(self, space):
288288
return self.value.tolong()
289289

290290
def unwrap_float(self, space):
291-
return self.value.tofloat()
291+
try:
292+
return self.value.tofloat()
293+
except OverflowError:
294+
raise error.UnwrappingError
292295

293296
def clone(self, space):
294297
return W_LargeIntegerBig(space, self.getclass(space), self.value, self.size())

0 commit comments

Comments
 (0)