From 7971191ab83c2f7b249f40dc2931e9d00aff00f8 Mon Sep 17 00:00:00 2001 From: Herwin Date: Tue, 6 Jan 2026 14:34:58 +0100 Subject: [PATCH] Add spec for passing String argument with Float number to Math.log10 This test was present with log2 and log1p, but missing in log10. --- core/math/log10_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/math/log10_spec.rb b/core/math/log10_spec.rb index c4daedcd5c..f3bd7fd4b8 100644 --- a/core/math/log10_spec.rb +++ b/core/math/log10_spec.rb @@ -23,6 +23,10 @@ -> { Math.log10("test") }.should raise_error(TypeError) end + it "raises a TypeError if passed a numerical argument as a string" do + -> { Math.log10("1.0") }.should raise_error(TypeError) + end + it "returns NaN given NaN" do Math.log10(nan_value).nan?.should be_true end