Ad
  • Custom User Avatar

    Math is allowed, what you are getting is:
    "Math::DomainError (Numerical argument is out of domain - "sqrt")"
    you could use 'raise' to attend it or use logical expression to ensure the positive range of the number before use Math::sqrt

  • Custom User Avatar

    You get this error when you pass a negative value to Math.sqrt. You can't pass negative to it.