Skip to content

Instantly share code, notes, and snippets.

@NetguruGist
Created November 2, 2015 07:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NetguruGist/1e6acfc128fcf521156e to your computer and use it in GitHub Desktop.
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