Last active
April 12, 2017 08:07
-
-
Save bxcodec/8d1a04270a594ee5da3d9c00ce08f17b to your computer and use it in GitHub Desktop.
Using Saint
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
package main | |
import ( | |
"fmt" | |
"github.com/bxcodec/saint" | |
) | |
func main() { | |
arr:=[] int {2,1,3,5,6} // array of integers | |
var x int | |
x= saint.Max(arr...) // get the maximun value from the array | |
fmt.Println(x) // 6 | |
x= saint.Max(4,3,1,5,7) // get the maximun value from the parameters inserted | |
fmt.Println(x) // 7 | |
x= saint.Min(arr...) // get the minimun value from the array | |
fmt.Println(x) // 1 | |
x= saint.Min(4,3,5,5,7) | |
fmt.Println(x) // 3 | |
x= saint.Sum(arr...) // sum all of value in the array | |
fmt.Println(x) // 17 | |
x = saint.Sum(4,5) // sum between 2 numbers | |
fmt.Println(x) // 9 | |
x = -5 | |
fmt.Println(saint.Abs(x)) // Get the absolute value from the x | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment