Standard library / math/bits

bits.Rem64()

Computes double-width dividend remainder; panics on zero divisor but not quotient overflow. Expected stdout: '2\n'.

Formal Syntax & Structure

go syntaxgo
func Rem64(hi, lo, y uint64) uint64

Parameters & Attributes

NameTypeDescription
hiuint64High word of the double-width input.
louint64Low word of the double-width input.
yuint64Second input operand.

Return Value

uint64

Computes double-width dividend remainder; panics on zero divisor but not quotient overflow.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math/bits")
func main() {  fmt.Println(bits.Rem64(0, 17, 5))}
Go Reference