Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rdoc (8.0.0)
rdoc (8.1.0)
erb
prism (>= 1.6.0)
rbs (>= 4.0.0)
Expand Down
24 changes: 12 additions & 12 deletions core/complex.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,7 @@ class Complex < Numeric
#
def self.polar: (Numeric, ?Numeric) -> Complex

# <!--
# rdoc-file=complex.c
# - Complex.rect(real, imag = 0) -> complex
# -->
# <!-- rdoc-file=complex.c -->
# Returns a new Complex object formed from the arguments, each of which must be
# an instance of Numeric, or an instance of one of its subclasses: Complex,
# Float, Integer, Rational; see [Rectangular
Expand Down Expand Up @@ -694,16 +691,19 @@ class Complex < Numeric
def real?: () -> false

# <!-- rdoc-file=complex.c -->
# Returns a new Complex object formed from the arguments, each of which must be
# an instance of Numeric, or an instance of one of its subclasses: Complex,
# Float, Integer, Rational; see [Rectangular
# Coordinates](rdoc-ref:Complex@Rectangular+Coordinates):
# Returns the array <code>[self.real, self.imag]</code>:
#
# Complex.rect(3) # => (3+0i)
# Complex.rect(3, Math::PI) # => (3+3.141592653589793i)
# Complex.rect(-3, -Math::PI) # => (-3-3.141592653589793i)
# Complex.rect(1, 2).rect # => [1, 2]
#
# Complex.rectangular is an alias for Complex.rect.
# See [Rectangular Coordinates](rdoc-ref:Complex@Rectangular+Coordinates).
#
# If `self` was created with [polar
# coordinates](rdoc-ref:Complex@Polar+Coordinates), the returned value is
# computed, and may be inexact:
#
# Complex.polar(1.0, 1.0).rect # => [0.5403023058681398, 0.8414709848078965]
#
# Complex#rectangular is an alias for Complex#rect.
#
def rect: () -> [ Numeric, Numeric ]

Expand Down
15 changes: 3 additions & 12 deletions core/dir.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,7 @@ class Dir
#
def self.chroot: (path root) -> 0

# <!--
# rdoc-file=dir.c
# - Dir.rmdir(dirpath) -> 0
# -->
# <!-- rdoc-file=dir.c -->
# Removes the directory at `dirpath` from the underlying file system:
#
# Dir.rmdir('foo') # => 0
Expand Down Expand Up @@ -719,10 +716,7 @@ class Dir
def self.open: (path dirname, ?encoding: encoding?) -> instance
| [U] (path dirname, ?encoding: encoding?) { (instance) -> U } -> U

# <!--
# rdoc-file=dir.c
# - Dir.pwd -> string
# -->
# <!-- rdoc-file=dir.c -->
# Returns the path to the current working directory:
#
# Dir.chdir("/tmp") # => 0
Expand All @@ -742,10 +736,7 @@ class Dir
#
alias self.rmdir self.delete

# <!--
# rdoc-file=dir.c
# - Dir.rmdir(dirpath) -> 0
# -->
# <!-- rdoc-file=dir.c -->
# Removes the directory at `dirpath` from the underlying file system:
#
# Dir.rmdir('foo') # => 0
Expand Down
11 changes: 2 additions & 9 deletions core/file.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -1027,11 +1027,7 @@ class File < IO
#
def self.ctime: (path | IO file_name) -> Time

# <!--
# rdoc-file=file.c
# - File.delete(file_name, ...) -> integer
# - File.unlink(file_name, ...) -> integer
# -->
# <!-- rdoc-file=file.c -->
# Deletes the named files, returning the number of names passed as arguments.
# Raises an exception on any error. Since the underlying implementation relies
# on the <code>unlink(2)</code> system call, the type of exception raised
Expand Down Expand Up @@ -1078,10 +1074,7 @@ class File < IO
#
def self.dirname: (path file_name, ?Integer level) -> String

# <!--
# rdoc-file=file.c
# - File.zero?(file_name) -> true or false
# -->
# <!-- rdoc-file=file.c -->
# Returns `true` if the named file exists and has a zero size.
#
# *file_name* can be an IO object.
Expand Down
127 changes: 0 additions & 127 deletions core/float.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -125,133 +125,6 @@
# representation of `self` in the given radix.
# * #truncate: Returns `self` truncated to a given precision.
#
# <!-- rdoc-file=float.rb -->
# A Float object stores a real number using the native architecture's
# double-precision floating-point representation.
#
# ## Float Imprecisions
#
# Some real numbers can be represented precisely as Float objects:
#
# 37.5 # => 37.5
# 98.75 # => 98.75
# 12.3125 # => 12.3125
#
# Others cannot; among these are the transcendental numbers, including:
#
# * Pi, <em>蟺</em>: in mathematics, a number of infinite precision:
# 3.1415926535897932384626433... (to 25 places); in Ruby, it is of limited
# precision (in this case, to 16 decimal places):
#
# Math::PI # => 3.141592653589793
#
# * Euler's number, *e*: in mathematics, a number of infinite precision:
# 2.7182818284590452353602874... (to 25 places); in Ruby, it is of limited
# precision (in this case, to 15 decimal places):
#
# Math::E # => 2.718281828459045
#
# Some floating-point computations in Ruby give precise results:
#
# 1.0/2 # => 0.5
# 100.0/8 # => 12.5
#
# Others do not:
#
# * In mathematics, 2/3 as a decimal number is an infinitely-repeating
# decimal: 0.666... (forever); in Ruby, <code>2.0/3</code> is of limited
# precision (in this case, to 16 decimal places):
#
# 2.0/3 # => 0.6666666666666666
#
# * In mathematics, the square root of 2 is an irrational number of infinite
# precision: 1.4142135623730950488016887... (to 25 decimal places); in Ruby,
# it is of limited precision (in this case, to 16 decimal places):
#
# Math.sqrt(2.0) # => 1.4142135623730951
#
# * Even a simple computation can introduce imprecision:
#
# x = 0.1 + 0.2 # => 0.30000000000000004
# y = 0.3 # => 0.3
# x == y # => false
#
# See:
#
# * https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
# * https://github.com/rdp/ruby_tutorials_core/wiki/Ruby-Talk-FAQ#-why-are-rub
# ys-floats-imprecise
# * https://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
#
# Note that precise storage and computation of rational numbers is possible
# using Rational objects.
#
# ## Creating a Float
#
# You can create a Float object explicitly with:
#
# * A [floating-point literal](rdoc-ref:syntax/literals.rdoc@Float+Literals).
#
# You can convert certain objects to Floats with:
#
# * Method #Float.
#
# ## What's Here
#
# First, what's elsewhere. Class Float:
#
# * Inherits from [class Numeric](rdoc-ref:Numeric@What-27s+Here) and [class
# Object](rdoc-ref:Object@What-27s+Here).
# * Includes [module Comparable](rdoc-ref:Comparable@What-27s+Here).
#
# Here, class Float provides methods for:
#
# * [Querying](rdoc-ref:Float@Querying)
# * [Comparing](rdoc-ref:Float@Comparing)
# * [Converting](rdoc-ref:Float@Converting)
#
# ### Querying
#
# * #finite?: Returns whether `self` is finite.
# * #hash: Returns the integer hash code for `self`.
# * #infinite?: Returns whether `self` is infinite.
# * #nan?: Returns whether `self` is a NaN (not-a-number).
#
# ### Comparing
#
# * #<: Returns whether `self` is less than the given value.
# * #<=: Returns whether `self` is less than or equal to the given value.
# * #<=>: Returns a number indicating whether `self` is less than, equal to,
# or greater than the given value.
# * #== (aliased as #=== and #eql?): Returns whether `self` is equal to the
# given value.
# * #>: Returns whether `self` is greater than the given value.
# * #>=: Returns whether `self` is greater than or equal to the given value.
#
# ### Converting
#
# * #% (aliased as #modulo): Returns `self` modulo the given value.
# * #*: Returns the product of `self` and the given value.
# * #**: Returns the value of `self` raised to the power of the given value.
# * #+: Returns the sum of `self` and the given value.
# * #-: Returns the difference of `self` and the given value.
# * #/: Returns the quotient of `self` and the given value.
# * #ceil: Returns the smallest number greater than or equal to `self`.
# * #coerce: Returns a 2-element array containing the given value converted to
# a Float and `self`
# * #divmod: Returns a 2-element array containing the quotient and remainder
# results of dividing `self` by the given value.
# * #fdiv: Returns the Float result of dividing `self` by the given value.
# * #floor: Returns the greatest number smaller than or equal to `self`.
# * #next_float: Returns the next-larger representable Float.
# * #prev_float: Returns the next-smaller representable Float.
# * #quo: Returns the quotient from dividing `self` by the given value.
# * #round: Returns `self` rounded to the nearest value, to a given precision.
# * #to_i (aliased as #to_int): Returns `self` truncated to an Integer.
# * #to_s (aliased as #inspect): Returns a string containing the place-value
# representation of `self` in the given radix.
# * #truncate: Returns `self` truncated to a given precision.
#
class Float < Numeric
# <!--
# rdoc-file=numeric.c
Expand Down
10 changes: 2 additions & 8 deletions core/process.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -1340,10 +1340,7 @@ module Process
#
def self.waitall: () -> ::Array[[ Integer, Process::Status ]]

# <!--
# rdoc-file=process.c
# - Process.wait(pid = -1, flags = 0) -> integer
# -->
# <!-- rdoc-file=process.c -->
# Waits for a suitable child process to exit, returns its process ID, and sets
# <code>$?</code> to a Process::Status object containing information on that
# process. Which child it waits for depends on the value of the given `pid`:
Expand Down Expand Up @@ -1476,10 +1473,7 @@ module Process
#
def self.waitpid: (?Integer pid, ?Integer flags) -> Integer

# <!--
# rdoc-file=process.c
# - Process.wait2(pid = -1, flags = 0) -> [pid, status]
# -->
# <!-- rdoc-file=process.c -->
# Like Process.waitpid, but returns an array containing the child process `pid`
# and Process::Status `status`:
#
Expand Down
Loading
Loading