File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -442,7 +442,8 @@ class Float < Numeric
442442 # 13.0.divmod(4.0) # => [3, 1.0]
443443 # 13.0.divmod(Rational(4, 1)) # => [3, 1.0]
444444 #
445- def divmod : (Numeric) -> [ Numeric, Numeric ]
445+ def divmod : (Integer | Float | Rational) -> [ Integer, Float ]
446+ | (Numeric) -> [ Numeric, Numeric ]
446447
447448 def dup : () -> self
448449
Original file line number Diff line number Diff line change @@ -766,7 +766,8 @@ class Integer < Numeric
766766 # 13.divmod(Rational(4, 1)) # => [3, (1/1)]
767767 #
768768 def divmod : (Integer) -> [ Integer, Integer ]
769- | (Float) -> [ Float, Float ]
769+ | (Float) -> [ Integer, Float ]
770+ | (Rational) -> [ Integer, Rational ]
770771 | (Numeric) -> [ Numeric, Numeric ]
771772
772773 # <!--
Original file line number Diff line number Diff line change @@ -245,7 +245,8 @@ class Rational < Numeric
245245
246246 def div : (Numeric) -> Integer
247247
248- def divmod : (Numeric) -> [ Numeric, Numeric ]
248+ def divmod : (Integer | Float | Rational) -> [ Integer, Rational ]
249+ | (Numeric) -> [ Numeric, Numeric ]
249250
250251 def dup : () -> self
251252
You can’t perform that action at this time.
0 commit comments