Standard library / math/bits

bits.Mul64()

Multiplies two unsigned words, returning high and low halves of the full-width product. Expected stdout: '0 42\n'.

Formal Syntax & Structure

go syntaxgo
func Mul64(x, y uint64) (hi, lo uint64)

Parameters & Attributes

NameTypeDescription
xuint64First input operand (or sole input if unary).
yuint64Second input operand.

Return Value

(hi, lo uint64)

Multiplies two unsigned words, returning high and low halves of the full-width product.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math/bits")
func main() {  h, l := bits.Mul64(6, 7)  fmt.Println(h, l)}
Go Reference