bits.Mul() Function in Golang with Examples
bits.Mul() Function in Golang is used to find the full-width product of x and y. The execution time of this function does not depend on the inputs. To access this function, one needs to imports the math/bits package in the program.
func Mul(x, y uint) (hi, lo uint)
Parameters: This function takes two parameter of uint type, i.e., x, y.
Note: (hi, lo) = x * y
Here, hi is the product bits’ upper half and, lo is the lower half returned.
Return Value: This function returns the full-width product of x and y.
Full-width product of x and y : 0 50
Number 1: 34 Number 2: 56 Upper half: 0 Lower half: 1904