File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
core/src/main/java/org/jruby Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -720,4 +720,20 @@ private static boolean negZero(final double x) {
720720 }
721721
722722 }
723+
724+ @ JRubyMethod (module = true , visibility = Visibility .PRIVATE )
725+ public static IRubyObject expm1 (ThreadContext context , IRubyObject unused , IRubyObject x ) {
726+ return asFloat (context , Math .expm1 (toDouble (context , x )));
727+ }
728+
729+ @ JRubyMethod (module = true , visibility = Visibility .PRIVATE )
730+ public static IRubyObject log1p (ThreadContext context , IRubyObject unused , IRubyObject x ) {
731+ double xDouble = toDouble (context , x );
732+
733+ if (xDouble < -1.0 ) {
734+ throw context .runtime .newMathDomainError ("Numerical argument is out of domain - log1p" );
735+ }
736+
737+ return asFloat (context , Math .log1p (xDouble ));
738+ }
723739}
You can’t perform that action at this time.
0 commit comments