aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/numeric.c b/numeric.c
index 74771cba6f..74ee5d136a 100644
--- a/numeric.c
+++ b/numeric.c
@@ -243,7 +243,10 @@ rb_num_get_rounding_option(VALUE opts)
break;
}
invalid:
- rb_raise(rb_eArgError, "invalid rounding mode: % "PRIsVALUE, rounding);
+ if (NIL_P(rounding))
+ rb_raise(rb_eArgError, "invalid rounding mode: nil");
+ else
+ rb_raise(rb_eArgError, "invalid rounding mode: % "PRIsVALUE, rounding);
}
noopt:
return RUBY_NUM_ROUND_DEFAULT;