Standard library / math

math.MaxInt16

Maximum representable int16 value; useful for bounds checks. Expected stdout: '32767\n'.

Formal Syntax & Structure

go syntaxgo
const MaxInt16  = 1<<15 - 1

Working Example

Example Snippetgo
package main
import (  "fmt"  "math")
func main() {  fmt.Println(int16(math.MaxInt16))}
Go Reference