Learn and Learn

Learn And Learn - great place for tutorials, references and how-to

GoLang – Find not-a-number value – NaN() Function – Examples & Explanation

NaN() function is used to find the IEEE 754 “not-a-number” value in Go language. The standard math package of Go programming language has NaN() function.

Syntax of NaN() Function in Go Language

The syntax of NaN() function in Go Language is:

Note: float64 is a data type in Go language which has IEEE-754 64-bit floating-point numbers.

 

Parameters of NaN() Function in Go

The parameter is not required.

 

Error Handling

If you enter any value as a parameter, it will produce an error .

 

Return Value of NaN() Function in Go

NaN() function will return an IEEE 754 “not-a-number” value.

 

GoLang NaN() Function Example


Output:
NaN

 

LearnAndLearn.com © 2018 - All rights reserved