Overview A floating-point number could have below properties It could have a negative and positive sign The integer part could be optional when the decimal part is present The dot and decimal…
Tag: number
Get ASCII code/value of any Alphabet or Number in Go (Golang)
range over a string can give the ASCII of all the characters in the string. In below code we are printing the ASCII value of a lowercase alphabets, uppercase alphabets and numbers….
Check if a number is negative or positive in Go (Golang)
Overview math package of GO provides a Signbit method that can be used to check whether a given number is negative or positive. It returns true for a negative number It returns…
Cube Root of a number in Go (Golang)
Overview math package of GO provides a Cbrt method that can be used to get the cube root of that number. Below is the signature of the function. It takes input a…
Get absolute value of a number in Go (Golang)
Overview math package of GO provides an Abs method that can be used to get the absolute value of a number. Below is the signature of the function. It takes input a…
Floor of a number in Go (Golang)
Overview math package of go provides a Floor method that can be used to get the ceil of a number. Floor of a number is the greatest integer value less than or…