Skip to content

Commit 4bda036

Browse files
committed
[DOC] Combine the negation operators to the literal numerics
1 parent fb50b3e commit 4bda036

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/mathn.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ def quo(other) super.canonicalize end
104104
# Standard Math module behaviour:
105105
# Math.sqrt(4/9) # => 0.0
106106
# Math.sqrt(4.0/9.0) # => 0.6666666666666666
107-
# Math.sqrt(- 4/9) # => Errno::EDOM: Numerical argument out of domain - sqrt
107+
# Math.sqrt(-4/9) # => Errno::EDOM: Numerical argument out of domain - sqrt
108108
#
109109
# When using +Math::N+, this is changed to:
110110
#
111111
# require 'mathn'
112112
# using Math::N
113113
# Math.sqrt(4/9) # => 2/3
114114
# Math.sqrt(4.0/9.0) # => 0.666666666666666
115-
# Math.sqrt(- 4/9) # => Complex(0, 2/3)
115+
# Math.sqrt(-4/9) # => Complex(0, 2/3)
116116

117117
def sqrt(a)
118118
return super unless a.respond_to?(:negative?)
@@ -139,7 +139,7 @@ def sqrt(a)
139139
# Standard Math module behaviour:
140140
# Math.cbrt(8/27) # => 0.0
141141
# Math.cbrt(8.0/27.0) # => 0.666666666666666
142-
# Math.cbrt(- 8/27) # => -1.0
142+
# Math.cbrt(-8/27) # => -1.0
143143
#
144144
# When using +Math::N+, this is changed to:
145145
#

0 commit comments

Comments
 (0)