Standard library / math/bits

bits.Reverse64()

Reverses bit order across the entire word, not just the significant bits. Expected stdout: '13\n'.

Formal Syntax & Structure

go syntaxgo
func Reverse64(x uint64) uint64

Parameters & Attributes

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

Return Value

uint64

Reverses bit order across the entire word, not just the significant bits.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math/bits")
func main() {  fmt.Println(bits.Reverse64(bits.Reverse64(13)))}
Go Reference