method

magnitude

Importance_1
Ruby latest stable (v2_5_5) - 0 notes - Class: Rational
magnitude() public

Returns the absolute value of rat.

(1/2r).abs    #=> (1/2)
(-1/2r).abs   #=> (1/2)

Rational#magnitude is an alias for Rational#abs.

Show source
Register or log in to add new notes.