Skip to content

Commit

Permalink
use the 1.8 way of making a float so we match on error for bad types …
Browse files Browse the repository at this point in the history
…in Math.log10
enebo committed Aug 18, 2016
1 parent 2b199e8 commit b2d9582
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyMath.java
Original file line number Diff line number Diff line change
@@ -447,7 +447,7 @@ public static RubyFloat log_19(IRubyObject recv, IRubyObject[] args) {
*/
@JRubyMethod(name = "log10", required = 1, module = true, visibility = Visibility.PRIVATE, compat = CompatVersion.RUBY1_8)
public static RubyFloat log10(IRubyObject recv, IRubyObject x) {
double result = Math.log10(needFloat(x).getDoubleValue());
double result = Math.log10(((RubyFloat) RubyKernel.new_float(recv,x)).getDoubleValue());
domainCheck(recv, result, "log10");
return RubyFloat.newFloat(recv.getRuntime(),result);
}

0 comments on commit b2d9582

Please sign in to comment.