It adds support for Ruby's other numeric types Fixnum, Bignum, and Rational, which can be automatically cast by the Ruby CPI to a Float. I did not add Complex support, because it's not 100% safe (e.g. Complex(1, 1) cannot be cast to a Float).
# Before this patch
RutieExample.rutie_float_test(10)
# PANIC!! π
# Before this patch
RutieExample.rutie_float_test(1/2r)
# PANIC!! π
# After this patch
RutieExample.rutie_float_test(10)
# => 20 π
This PR fixes #99 that I reported yesterday.
It adds support for Ruby's other numeric types
Fixnum
,Bignum
, andRational
, which can be automatically cast by the Ruby CPI to aFloat
. I did not addComplex
support, because it's not 100% safe (e.g.Complex(1, 1)
cannot be cast to a Float).Result: