End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Rational#-@
-rat → rational
rational.c
View on GitHub ↗
VALUE
rb_rational_uminus(VALUE self)
{
const int unused = (assert(RB_TYPE_P(self, T_RATIONAL)), 0);
get_dat1(self);
(void)unused;
return f_rational_new2(CLASS_OF(self), rb_int_uminus(dat->num), dat->den);
}
Negates rat.