Standard library / math
math.Remainder()
IEEE remainder using nearest integer quotient, ties to even; differs from Mod. Expected stdout: '-1\n'.
Formal Syntax & Structure
go syntaxgo
func Remainder(x, y float64) float64Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | float64 | First input operand (or sole input if unary). |
| y | float64 | Second input operand. |
Return Value
float64
IEEE remainder using nearest integer quotient, ties to even; differs from Mod.
Working Example
Example Snippetgo
package main
import ( "fmt" "math")
func main() { fmt.Println(math.Remainder(7, 4))}