A rational number is either an integer or a ratio

Mimics
Inactive cells
Active cells
Specs
Inactive cells (details)
kind = "Number Rational"
Active cells (details)
*(multiplier)

returns the product of this number and the argument. if the argument is a decimal, the receiver will be converted into a form suitable for multiplying against a decimal, and then multiplied. if the argument is neither a Rational nor a Decimal, it tries to call asRational, and if that fails it signals a condition.

**(exponent)

returns this number to the power of the argument

+(addend)

returns the addition of this number and the argument. if the argument is a decimal, the receiver will be converted into a form suitable for addition against a decimal, and then added. if the argument is neither a Rational nor a Decimal, it tries to call asRational, and if that fails it signals a condition.

-(subtrahend)

returns the difference between this number and the argument. if the argument is a decimal, the receiver will be converted into a form suitable for subtracting against a decimal, and then subtracted. if the argument is neither a Rational nor a Decimal, it tries to call asRational, and if that fails it signals a condition.

/(dividend)

returns the quotient of this number and the argument. if the division is not exact, it will return a Ratio.

<=>(other)

compares this number against the argument, returning -1, 0 or 1 based on which one is larger. if the argument is a decimal, the receiver will be converted into a form suitable for comparing against a decimal, and then compared - it's not specified whether this will actually call Decimal#<=> or not. if the argument is neither a Rational nor a Decimal, it tries to call asRational, and if that doesn't work it returns nil.

==(other)

compares this number against the argument, true if this number is the same, otherwise false

===(other)

nil

method(other, 
  if(self same?(
      0), 
    Reflector other:mimics?(cell(:other), 
      0), 
    bind(rescue(Condition Error, fn(c, false)), 
      self ==(
        other))))
asText()

Returns a text representation of the object

inspect()

Returns a text inspection of the object

notice()

Returns a brief text inspection of the object

sqrt()

returns the square root of the receiver. this should return the same result as calling ** with 0.5