# Introduction To Numeric Constants In Go

DevFeed: [Introduction To Numeric Constants In Go](<https://devfeed.tech/articles/introduction-to-numeric-constants-in-go-22099.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2014/04/introduction-to-numeric-constants-in-go.html>)

Published: 2014-04-06T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [Code](<https://devfeed.tech/topics/code.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>)

Tags: [ardan-labs](<https://devfeed.tech/tags/ardan-labs.md>), [blog](<https://devfeed.tech/tags/blog.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [floating-point](<https://devfeed.tech/tags/floating-point.md>), [go](<https://devfeed.tech/tags/go.md>), [go-programming](<https://devfeed.tech/tags/go-programming.md>), [golang](<https://devfeed.tech/tags/golang.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [language](<https://devfeed.tech/tags/language.md>), [precision](<https://devfeed.tech/tags/precision.md>), [programming](<https://devfeed.tech/tags/programming.md>)

## AI overview

This tutorial explains how Go represents numeric constants, including the distinction between typed and untyped constants. It covers the four constant kinds--integer, floating-point, complex, and rune--and explains how literal syntax determines a numeric constant's kind.

## Source excerpt

Introduction One of the more unique features of Go is how the language implements constants. The rules for constants in the language specification are unique to Go. They provide the flexibility Go needs at the compiler level to make the code we write readable and intuitive while still maintaining a type safe language. This post will attempt to build a foundation for what numeric constants are, how they behave in their simplest form and how best to talk about them. There are a lot of little nuances, terms and concepts that can trip us up. Because of this, the post is going to take things slowly. So if you are ready to peek under the covers just a bit, roll up your sleeve and let's get started: Untyped and Typed Numeric Constants Constants can be declared with or without a type in Go. When we declare literal values in our code, we are actually declaring constants that are both untyped and unnamed. The following examples show typed and untyped numeric constants that are both named and unnamed: