instance method
Numeric#<=>
(::Numeric other) -> ::Integer
self <=> other → zero or nil
numeric.c
View on GitHub ↗
static VALUE
num_cmp(VALUE x, VALUE y)
{
if (x == y) return INT2FIX(0);
return Qnil;
}
Compares self and other.
Returns:
-
Zero, if
selfis the same asother. -
nil, otherwise.
Class Numeric includes module Comparable, each of whose methods uses Numeric#<=> for comparison.
No subclass in the Ruby Core or Standard Library uses this implementation.