Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

binary - octal - hex

This representation exists only from 1.13

package main

import "fmt"

func main() {
	decimal := 42
	binary  := 0b101010
	octal   := 0o52
	hexa    := 0x2A 
	fmt.Println(decimal)
	fmt.Println(binary)
	fmt.Println(octal)
	fmt.Println(hexa)
}
42
42
42
42