Standard library / math/bits
bits.Reverse()
Reverses bit order across the entire word, not just the significant bits. Native uint width is architecture-dependent; local validation uses 64 bits. Expected stdout: '13\n'.
Formal Syntax & Structure
go syntaxgo
func Reverse(x uint) uintParameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | uint | First input operand (or sole input if unary). |
Return Value
uint
Reverses bit order across the entire word, not just the significant bits. 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.Reverse(bits.Reverse(13)))}