Method: Math.sqrt

Defined in:
lib/rails_units/math.rb

.sqrt(n) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/rails_units/math.rb', line 8

def sqrt(n)
  if Unit === n
    (n**(Rational(1,2))).to_unit 
  else
    unit_sqrt(n)
  end
end