Skip to content

Commit 0f3746b

Browse files
committedFeb 22, 2018
Align Float methods with CRuby.
1 parent f5bb3a9 commit 0f3746b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎core/src/main/java/org/jruby/RubyFloat.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,13 @@ public int signum() {
198198
}
199199

200200
@Override
201+
@JRubyMethod(name = "negative?")
201202
public IRubyObject isNegative(ThreadContext context) {
202203
return context.runtime.newBoolean(signum() < 0);
203204
}
204205

205206
@Override
207+
@JRubyMethod(name = "positive?")
206208
public IRubyObject isPositive(ThreadContext context) {
207209
return context.runtime.newBoolean(signum() > 0);
208210
}
@@ -232,7 +234,7 @@ public static IRubyObject induced_from(ThreadContext context, IRubyObject recv,
232234
/** flo_to_s
233235
*
234236
*/
235-
@JRubyMethod(name = "to_s")
237+
@JRubyMethod(name = {"to_s", "inspect"})
236238
@Override
237239
public IRubyObject to_s() {
238240
final Ruby runtime = getRuntime();
@@ -373,7 +375,7 @@ public IRubyObject op_div(ThreadContext context, double other) { // don't overri
373375
/** flo_quo
374376
*
375377
*/
376-
@JRubyMethod(name = "quo")
378+
@JRubyMethod(name = {"quo", "fdiv"})
377379
public IRubyObject quo(ThreadContext context, IRubyObject other) {
378380
return numFuncall(context, this, sites(context).op_quo, other);
379381
}
@@ -474,7 +476,7 @@ public IRubyObject op_pow19(ThreadContext context, IRubyObject other) {
474476
/** flo_eq
475477
*
476478
*/
477-
@JRubyMethod(name = "==", required = 1)
479+
@JRubyMethod(name = {"==", "==="}, required = 1)
478480
@Override
479481
public IRubyObject op_equal(ThreadContext context, IRubyObject other) {
480482
if (Double.isNaN(value)) {

0 commit comments

Comments
 (0)
Please sign in to comment.