core/numeric.rbs in rbs-3.3.2 vs core/numeric.rbs in rbs-3.4.0.pre.1
- old
+ new
@@ -194,12 +194,10 @@
# r % r2 # => (21/100)
# r % -r2 # => (-119/100)
# (-r) % r2 # => (119/100)
# (-r) %-r2 # => (-21/100)
#
- # Numeric#modulo is an alias for Numeric#%.
- #
def %: (Numeric) -> Numeric
# Performs addition: the class of the resulting object depends on the class of
# `numeric`.
#
@@ -244,12 +242,10 @@
#
# 12.abs #=> 12
# (-34.56).abs #=> 34.56
# -34.56.abs #=> 34.56
#
- # Numeric#magnitude is an alias for Numeric#abs.
- #
def abs: () -> Numeric
# <!--
# rdoc-file=complex.c
# - num.abs2 -> real
@@ -327,14 +323,13 @@
#
def conj: () -> Numeric
# <!--
# rdoc-file=numeric.rb
- # - num.conj -> self
- # - num.conjugate -> self
+ # - conj -> self
# -->
- # Returns self.
+ # Returns `self`.
#
def conjugate: () -> Numeric
# <!--
# rdoc-file=rational.c
@@ -419,13 +414,13 @@
#
def fdiv: (Numeric) -> Numeric
# <!--
# rdoc-file=numeric.rb
- # - num.finite? -> true or false
+ # - finite? -> true or false
# -->
- # Returns `true` if `num` is a finite number, otherwise returns `false`.
+ # Returns `true` if `self` is a finite number, `false` otherwise.
#
def finite?: () -> bool
# <!--
# rdoc-file=numeric.c
@@ -461,46 +456,43 @@
#
def imag: () -> Numeric
# <!--
# rdoc-file=numeric.rb
- # - num.imag -> 0
- # - num.imaginary -> 0
+ # - imag -> 0
# -->
# Returns zero.
#
def imaginary: () -> Numeric
# <!--
# rdoc-file=numeric.rb
- # - num.infinite? -> -1, 1, or nil
+ # - infinite? -> -1, 1, or nil
# -->
- # Returns `nil`, -1, or 1 depending on whether the value is finite, `-Infinity`,
- # or `+Infinity`.
+ # Returns `nil`, -1, or 1 depending on whether `self` is finite, `-Infinity`, or
+ # `+Infinity`.
#
def infinite?: () -> Integer?
# <!--
# rdoc-file=numeric.rb
- # - num.integer? -> true or false
+ # - integer? -> true or false
# -->
- # Returns `true` if `num` is an Integer.
+ # Returns `true` if `self` is an Integer.
#
- # 1.0.integer? #=> false
- # 1.integer? #=> true
+ # 1.0.integer? # => false
+ # 1.integer? # => true
#
def integer?: () -> bool
# <!-- rdoc-file=numeric.c -->
# Returns the absolute value of `self`.
#
# 12.abs #=> 12
# (-34.56).abs #=> 34.56
# -34.56.abs #=> 34.56
#
- # Numeric#magnitude is an alias for Numeric#abs.
- #
alias magnitude abs
# <!-- rdoc-file=numeric.c -->
# Returns `self` modulo `other` as a real number.
#
@@ -528,12 +520,10 @@
# r % r2 # => (21/100)
# r % -r2 # => (-119/100)
# (-r) % r2 # => (119/100)
# (-r) %-r2 # => (-21/100)
#
- # Numeric#modulo is an alias for Numeric#%.
- #
def modulo: (Numeric) -> Numeric
# <!--
# rdoc-file=numeric.c
# - negative? -> true or false
@@ -598,21 +588,21 @@
#
def quo: (Numeric) -> Numeric
# <!--
# rdoc-file=numeric.rb
- # - num.real -> self
+ # - real -> self
# -->
- # Returns self.
+ # Returns `self`.
#
def real: () -> Numeric
# <!--
# rdoc-file=numeric.rb
- # - num.real? -> true or false
+ # - real? -> true or false
# -->
- # Returns `true` if `num` is a real number (i.e. not Complex).
+ # Returns `true` if `self` is a real number (i.e. not Complex).
#
def real?: () -> bool
# <!-- rdoc-file=complex.c -->
# Returns an array; [num, 0].
@@ -695,15 +685,15 @@
# squares # => [1, 9, 25, 49, 81]
#
# The generated sequence:
#
# - Begins with +self+.
- # - Continues at intervals of +step+ (which may not be zero).
- # - Ends with the last number that is within or equal to +limit+;
- # that is, less than or equal to +limit+ if +step+ is positive,
- # greater than or equal to +limit+ if +step+ is negative.
- # If +limit+ is not given, the sequence is of infinite length.
+ # - Continues at intervals of +by+ (which may not be zero).
+ # - Ends with the last number that is within or equal to +to+;
+ # that is, less than or equal to +to+ if +by+ is positive,
+ # greater than or equal to +to+ if +by+ is negative.
+ # If +to+ is +nil+, the sequence is of infinite length.
#
# If a block is given, calls the block with each number in the sequence;
# returns +self+. If no block is given, returns an Enumerator::ArithmeticSequence.
#
# <b>Keyword Arguments</b>
@@ -741,10 +731,10 @@
# e = 3.step(by: -1.5, to: -3) # => (3.step(by: -1.5, to: -3))
# e.class # => Enumerator::ArithmeticSequence
#
# <b>Positional Arguments</b>
#
- # With optional positional arguments +limit+ and +step+,
+ # With optional positional arguments +to+ and +by+,
# their values (or defaults) determine the step and limit:
#
# squares = []
# 4.step(10, 2) {|i| squares.push(i*i) } # => 4
# squares # => [16, 36, 64, 100]