Introduction
Yukihiro Matsumoto desired a scripting language that was more powerful than Perl and more object-oriented than Python, so he created Ruby.
Ruby is an open-source, interpreted, high-level, dynamic, general-purpose programming language focusing on productivity and simplicity.
As you'd expect from a contemporary language, Ruby has many operators. In this blog, we will discuss Ruby's double splat operator(**).
Let's get started with the ** operator in Ruby.
Double Splat Operator (**)
A symbol denoting an operation performed with one or more operands is called an operator. Any programming language's base is made up of operators. We may use operators to execute a variety of actions on operands.
In Ruby, several distinct types of operators; we'll discuss the Exponentiation operator.
** operator is used to return the exponential power of the operators. For example, a**b.
It performs Exponentiation, which means it raises the first argument to the power of the second.
It's worth noting that a fractional number can be used as the second argument to compute the roots of a number. For example, the cube root of a is a**(1.0/3.0). Similarly, a**-b is the same as 1/(a**b).