Skip to content
instance method

Rational#*

(::BigDecimal) -> ::BigDecimal
(::Integer) -> ::Rational
(::Rational) -> ::Rational
[T < ::Numeric] (T) -> T
self * other → numeric

Returns the numeric product of self and other:

Example
Rational(9, 8)  * 4               #=> (9/2)
Rational(20, 9) * 9.8             #=> 21.77777777777778
Rational(9, 8)  * Complex(1, 2)   # => ((9/8)+(9/4)*i)
Rational(2, 3)  * Rational(2, 3)  #=> (4/9)
Rational(900)   * Rational(1)     #=> (900/1)
Rational(-2, 9) * Rational(-9, 2) #=> (1/1)
See also .json_create #** #+ also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0