summaryrefslogtreecommitdiffhomepage
path: root/src/numeric.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-07-04 21:52:51 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-07-04 21:52:51 +0900
commitc16bb3fee3ba0dfcd74b82fd2167c3fdd0593ba9 (patch)
treec5d8c2e53a06d1c3c25640924aa73a7a89c34b59 /src/numeric.c
parent742f85752d52b8f93d80674da600963a5f303980 (diff)
parenta50464fe0171305929fd9bda11b8bc474511b764 (diff)
downloadmruby-c16bb3fee3ba0dfcd74b82fd2167c3fdd0593ba9.tar.gz
mruby-c16bb3fee3ba0dfcd74b82fd2167c3fdd0593ba9.zip
Merge pull request #2446 from take-cheeze/fix_mrb_flo_to_fixnum
Fix type checking in `mrb_flo_to_fixnum`.
Diffstat (limited to 'src/numeric.c')
-rw-r--r--src/numeric.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/numeric.c b/src/numeric.c
index db1e7d0f4..b8c3ae4a4 100644
--- a/src/numeric.c
+++ b/src/numeric.c
@@ -1085,7 +1085,7 @@ mrb_flo_to_fixnum(mrb_state *mrb, mrb_value x)
{
mrb_int z;
- if (mrb_float_p(x)) {
+ if (!mrb_float_p(x)) {
mrb_raise(mrb, E_TYPE_ERROR, "non float value");
z = 0; /* not reached. just suppress warnings. */
}