Method: Rust::MathArray#**

Defined in:
lib/rust/core/types/utils.rb

#**(other) ⇒ Object

Raises:

  • (ArgumentError)


111
112
113
114
115
116
117
118
119
120
# File 'lib/rust/core/types/utils.rb', line 111

def **(other)
    raise ArgumentError, "Expected numeric" if !other.is_a?(Numeric)
    
    result = self.clone
    for i in 0...self.size
        result[i] = result[i] ** other
    end
    
    return result
end