Skip to content

Instantly share code, notes, and snippets.

@NetguruGist
Created November 2, 2015 07:21
Show Gist options
  • Select an option

  • Save NetguruGist/1e6acfc128fcf521156e to your computer and use it in GitHub Desktop.

Select an option

Save NetguruGist/1e6acfc128fcf521156e to your computer and use it in GitHub Desktop.
error4 swift
func divide(dividend: Float, by divisor: Float) -> Float {
guard divisor != 0.0 else {
throw DivisionError.ByZero
}
return dividend/divisor
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment