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/826430355616211687b2 to your computer and use it in GitHub Desktop.
Save NetguruGist/826430355616211687b2 to your computer and use it in GitHub Desktop.
error5 swift
func divide(dividend: Float, by divisor: Float) throws -> 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