Learn and Learn

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

GoLang – Find Binary Representation – Float64bits() Function – Examples & Explanation

Float64bits() function is used to find the IEEE 754 binary representation of x for the given input (x – parameter) in Go language. The standard math package of Go programming language has Float64bits() function.

Syntax of Float64bits() Function in Go Programming

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

Note: float64 is a data type in Go language which has IEEE-754 64-bit floating-point numbers. uint64 is the set of all unsigned 64-bit integers.

 

Parameters of Float64bits() Function in Go Programming

x – Where x is any Valid float64 Input value. This parameter is required.

 

Error Handling

If the x parameter is not a number (numeric value) Float64bits() function returns an error .
If there is no argument (x – input value) passes to the function, then the compiler will produce an error.

 

Return Value of Float64bits() Function in Go Programming

Float64bits() function will return the IEEE 754 binary representation of the given input(x – parameter).

 

GoLang Float64bits() Function Example 1


Output:
4611686018427387904

 

GoLang Float64bits() Function Example 2


Output:
13849019214127012250

 

GoLang Float64bits() Function Example 3


Output:
4751297606873776128

 

LearnAndLearn.com © 2018 - All rights reserved