Standard library / math/bits

bits.Rem32()

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

Formal Syntax & Structure

go syntaxgo
func Rem32(hi, lo, y uint32) uint32

Parameters & Attributes

NameTypeDescription
hiuint32High word of the double-width input.
louint32Low word of the double-width input.
yuint32Second input operand.

Return Value

uint32

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.Rem32(0, 17, 5))}
Go Reference