Created
April 8, 2019 01:51
-
-
Save anettodev/7bf04d0aa2e49e75ab2cb6fe98e62fa1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sum 2 Numeric elements | |
func sum<T: Numeric>(x: T, y: T) -> T { | |
return x + y | |
} | |
sum(3, 4.5) // result 7.5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment