Overview math package of GO provides a Min method that can be used to get the minimum of two numbers. The Below is the signature of the function. It takes input two…
Category: Tech
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…
Calculate x^y – Pow() in Go (Golang)
Overview math package of GO provides a Pow method that can be used to calculate x to the power y. Below is the signature of the function. It takes input as two…
Break number into integer and fraction parts in Go (Golang)
Overview math package of GO provides a Modf method that can be used to break a floating-point number into integer and floating part. Please note that the integer part is also returned…
Remainder or Modulus in Go (Golang)
Overview In this tutorial we will study about % Operator – applicable to get remainder for integers Mod function – can be used to get remainder in case of floats also Remainder…
Log of number in Go (Golang)
Overview In this tutorial, we will see three types of logarithm possible Natural logarithm Binary Exponent Log (log e) Binary Log (log 2) Decimal Log (log 10) Natural logarithm math package of…
Square Root of a number in Go (Golang)
Overview math package of GO provides a Sqrt method that can be used to get the cube root of that number. Below is the signature of the function. It takes input a…
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…
Pi value in Go (Golang)
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:
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…