Results for: "match"

if /foo/ then end

^^^^^

Represents the use of the modifier ‘in` operator.

foo in bar
^^^^^^^^^^

Represents a regular expression literal used in the predicate of a conditional to implicitly match against the last line read by an IO object.

if /foo/i then end
   ^^^^^^

Represents the use of the ‘=>` operator.

foo => bar
^^^^^^^^^^

Represents writing local variables using a regular expression match with named capture groups.

/(?<foo>bar)/ =~ baz
^^^^^^^^^^^^^^^^^^^^

foo in bar ^^^^^^^^^^

foo in bar ^^^^^^^^^^

if /foo #{bar}/ then end

^^^^^^^^^^^^

case foo; in bar; end ^^^^^^^^^^^^^^^^^^^^^

foo => bar ^^^^^^^^^^

/(?<foo>foo)/ =~ bar ^^^^^^^^^^^^^^^^^^^^

case foo; in bar; end ^^^^^^^^^^^^^^^^^^^^^

foo => bar ^^^^^^^^^^

/(?<foo>foo)/ =~ bar ^^^^^^^^^^^^^^^^^^^^

No documentation available
No documentation available

if /foo/ then end

^^^^^

if /foo/ then end

^^^^^

Raised when attempting to convert special float values (in particular Infinity or NaN) to numerical classes which don’t support them.

Float::INFINITY.to_r   #=> FloatDomainError: Infinity

The Benchmark module provides methods to measure and report the time used to execute Ruby code.

The result:

              user     system      total        real
for:      1.010000   0.000000   1.010000 (  1.015688)
times:    1.000000   0.000000   1.000000 (  1.003611)
upto:     1.030000   0.000000   1.030000 (  1.028098)

mkmf.rb is used by Ruby C extensions to generate a Makefile which will correctly compile and link the C extension to Ruby and a third-party library.

Module Math provides methods for basic trigonometric, logarithmic, and transcendental functions, and for extracting roots.

You can write its constants and method calls thus:

Math::PI      # => 3.141592653589793
Math::E       # => 2.718281828459045
Math.sin(0.0) # => 0.0
Math.cos(0.0) # => 1.0

If you include module Math, you can write simpler forms:

include Math
PI       # => 3.141592653589793
E        # => 2.718281828459045
sin(0.0) # => 0.0
cos(0.0) # => 1.0

For simplicity, the examples here assume:

include Math
INFINITY = Float::INFINITY

The domains and ranges for the methods are denoted by open or closed intervals, using, respectively, parentheses or square brackets:

Many values returned by Math methods are numerical approximations. This is because many such values are, in mathematics, of infinite precision, while in numerical computation the precision is finite.

Thus, in mathematics, cos(π/2) is exactly zero, but in our computation cos(PI/2) is a number very close to zero:

cos(PI/2) # => 6.123031769111886e-17

For very large and very small returned values, we have added formatted numbers for clarity:

tan(PI/2)  # => 1.633123935319537e+16   # 16331239353195370.0
tan(PI)    # => -1.2246467991473532e-16 # -0.0000000000000001

See class Float for the constants that affect Ruby’s floating-point arithmetic.

What’s Here

Trigonometric Functions

Inverse Trigonometric Functions

Hyperbolic Trigonometric Functions

Inverse Hyperbolic Trigonometric Functions

Exponentiation and Logarithmic Functions

Fraction and Exponent Functions

Root Functions

Error Functions

Gamma Functions

Hypotenuse Function

Represents a regular expression literal that contains interpolation that is being used in the predicate of a conditional to implicitly match against the last line read by an IO object.

if /foo #{bar} baz/ then end
   ^^^^^^^^^^^^^^^^

Generated when trying to lookup a gem to indicate that the gem was found, but that it isn’t usable on the current platform.

fetch and install read these and report them to the user to aid in figuring out why a gem couldn’t be installed.

Represents the use of a case statement for pattern matching.

case true
in false
end
^^^^^^^^^
Search took: 7ms  ·  Total Results: 2599