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.
2 parents 727dd5e + d397fd8 commit 3c01628Copy full SHA for 3c01628
pixie/vm/numbers.py
@@ -320,7 +320,7 @@ def to_float(x):
320
return rt.wrap(float(x.int_val()))
321
if isinstance(x, BigInteger):
322
return rt.wrap(x.bigint_val().tofloat())
323
- assert False
+ object.runtime_error(u"Cannot convert %s to float" %x.type().name())
324
325
def to_float_conv(c):
326
if c == Float:
tests/pixie/tests/test-ffi.pxi
@@ -48,6 +48,10 @@
48
(t/assert= 0.5 (asinf (sinf 0.5)))
49
(t/assert= 1.0 (+ (powf (sinf 0.5) 2.0) (powf (cosf 0.5) 2.0))))
50
51
+(t/deftest test-invalid-float-argument
52
+ (t/assert-throws? (m/sin "nil"))
53
+ (t/assert-throws? (m/sin nil))
54
+ )
55
56
(t/deftest test-ffi-callbacks
57
(let [MAX 255
0 commit comments