4 ms·
Modulus Operator? Like the following: http://msdn.microsoft.com/en-us/library/0w4e0fzs.aspx http://msdn.microsoft.com/en-us/library/0w4e0fzs.aspx? If this is t
by touristtam 12y ago
Modulus Operator? Like the following: http://msdn.microsoft.com/en-us/library/0w4e0fzs.aspx http://msdn.microsoft.com/en-us/library/0w4e0fzs.aspx?
If this is the case, maybe you should check the doc: http://golang.org/ref/spec#Arithmetic_operators http://golang.org/ref/spec#Arithmetic_operators
try this: http://play.golang.org/p/WA0vX7zmNb http://play.golang.org/p/WA0vX7zmNb
I'll leave a copy of the code so you can try it locally as well (and in case the link to play.golang.org breaks)
package main
import "fmt"
func main() {
a := 47
b := 6
c := a % b
fmt.Println("input: ", a, b)
fmt.Println("output: ", c)
}
[edit]: someone beat me to it :/