summaryrefslogtreecommitdiff
path: root/kernel.rb
diff options
context:
space:
mode:
Diffstat (limited to 'kernel.rb')
-rw-r--r--kernel.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel.rb b/kernel.rb
index de20fffcf9..9cc58bc1d9 100644
--- a/kernel.rb
+++ b/kernel.rb
@@ -169,6 +169,10 @@ module Kernel
# Float("123.0_badstring", exception: false) #=> nil
#
def Float(arg, exception: true)
- Primitive.rb_f_float(arg, exception)
+ if Primitive.mandatory_only?
+ Primitive.rb_f_float1(arg)
+ else
+ Primitive.rb_f_float(arg, exception)
+ end
end
end