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) float64

Parameters & Attributes

NameTypeDescription
xfloat64First input operand (or sole input if unary).
yfloat64Second 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))}
Go Reference