-
-
Save banister/3852848b2b42e534908e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static VALUE | |
flo_mul(VALUE x, VALUE y) | |
{ | |
switch (TYPE(y)) { | |
case T_FIXNUM: | |
return DBL2NUM(RFLOAT_VALUE(x) * (double)FIX2LONG(y)); | |
case T_BIGNUM: | |
return DBL2NUM(RFLOAT_VALUE(x) * rb_big2dbl(y)); | |
case T_FLOAT: | |
return DBL2NUM(RFLOAT_VALUE(x) * RFLOAT_VALUE(y)); | |
default: | |
return rb_num_coerce_bin(x, y, '*'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment