Standard library / math/bits

bits.Reverse8()

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

Formal Syntax & Structure

go syntaxgo
func Reverse8(x uint8) uint8

Parameters & Attributes

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

Return Value

uint8

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.Reverse8(bits.Reverse8(13)))}
Go Reference