method
denominator
v1_9_2_180 -
Show latest stable
-
0 notes -
Class: Rational
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378 (0)
- 1_9_2_180 (38)
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (-2)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (-6)
- 2_6_3 (0)
- What's this?
denominator()
public
Returns the denominator (always positive).
For example:
Rational(7).denominator #=> 1 Rational(7, 1).denominator #=> 1 Rational(9, -4).denominator #=> 4 Rational(-2, -10).denominator #=> 5 rat.numerator.gcd(rat.denominator) #=> 1