Standard library / math/bits
bits.Reverse16()
Reverses bit order across the entire word, not just the significant bits. Expected stdout: '13\n'.
Formal Syntax & Structure
go syntaxgo
func Reverse16(x uint16) uint16Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | uint16 | First input operand (or sole input if unary). |
Return Value
uint16
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.Reverse16(bits.Reverse16(13)))}