pi Archives - Welcome To Golang By Example https://vikasboss.github.io/tag/pi/ Thu, 26 Mar 2020 05:13:03 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.1 https://i0.wp.com/golangbyexamples.com/wp-content/uploads/2021/05/cropped-go_border-1.png?fit=32%2C32&ssl=1 pi Archives - Welcome To Golang By Example https://vikasboss.github.io/tag/pi/ 32 32 159787465 Pi value in Go (Golang) https://vikasboss.github.io/pi-value-golang/ https://vikasboss.github.io/pi-value-golang/#respond Thu, 26 Mar 2020 05:12:58 +0000 https://vikasboss.github.io/?p=1839 Overview math package of GO provides a Pi constant. This is how it is defined in the constant.go file of math package. It is a float64 value Code: Output:

The post Pi value in Go (Golang) appeared first on Welcome To Golang By Example.

]]>
Overview

math package of GO provides a Pi constant.


This is how it is defined in the constant.go file of math package. It is a float64 value

Pi  = 3.14159265358979323846264338327950288419716939937510582097494459

Code:

package main

import (
	"fmt"
	"math"
)

func main() {
	pi := math.Pi
	fmt.Println(pi)
}

Output:

3.141592653589793

The post Pi value in Go (Golang) appeared first on Welcome To Golang By Example.

]]>
https://vikasboss.github.io/pi-value-golang/feed/ 0 1839