Standard library / math/bits
bits.Rem()
Computes double-width dividend remainder; panics on zero divisor but not quotient overflow. Native uint width is architecture-dependent; local validation uses 64 bits. Expected stdout: '2\n'.
Formal Syntax & Structure
go syntaxgo
func Rem(hi, lo, y uint) uintParameters & Attributes
| Name | Type | Description |
|---|---|---|
| hi | uint | High word of the double-width input. |
| lo | uint | Low word of the double-width input. |
| y | uint | Second input operand. |
Return Value
uint
Computes double-width dividend remainder; panics on zero divisor but not quotient overflow. Native uint width is architecture-dependent; local validation uses 64 bits.
Working Example
Example Snippetgo
package main
import ( "fmt" "math/bits")
func main() { fmt.Println(bits.Rem(0, 17, 5))}