Math functions
Use these functions to perform mathematical operations.
Use these functions to perform mathematical operations.
math.Abs VALUE ⟼ float64Returns the absolute value of the given number. Read More »
math.Acos VALUE ⟼ float64Returns the arccosine, in radians, of the given number. Read More »
math.Add VALUE VALUE... ⟼ anyAdds two or more numbers. Read More »
math.Asin VALUE ⟼ float64Returns the arcsine, in radians, of the given number. Read More »
math.Atan VALUE ⟼ float64Returns the arctangent, in radians, of the given number. Read More »
math.Atan2 VALUE VALUE ⟼ float64Returns the arctangent, in radians, of the given number pair, determining the correct quadrant from their signs. Read More »
math.Ceil VALUE ⟼ float64Returns the least integer value greater than or equal to the given number. Read More »
math.Cos VALUE ⟼ float64Returns the cosine of the given radian number. Read More »
math.Counter ⟼ uint64Increments and returns a global counter. Read More »
math.Div VALUE VALUE... ⟼ anyDivides the first number by one or more numbers. Read More »
math.Floor VALUE ⟼ float64Returns the greatest integer value less than or equal to the given number. Read More »
math.Log VALUE ⟼ float64Returns the natural logarithm of the given number. Read More »
math.Max VALUE... ⟼ float64Returns the greater of all numbers. Accepts scalars, slices, or both. Read More »
math.Min VALUE... ⟼ float64Returns the smaller of all numbers. Accepts scalars, slices, or both. Read More »
math.Mod VALUE1 VALUE2 ⟼ int64Returns the modulus of two integers. Read More »
math.ModBool VALUE1 VALUE2 ⟼ boolReports whether the modulus of two integers equals 0. Read More »
math.Mul VALUE VALUE... ⟼ anyMultiplies two or more numbers. Read More »
math.Pi ⟼ float64Returns the mathematical constant pi. Read More »
math.Pow VALUE1 VALUE2 ⟼ float64Returns the first number raised to the power of the second number. Read More »
math.Product VALUE... ⟼ float64Returns the product of all numbers. Accepts scalars, slices, or both. Read More »
math.Rand ⟼ float64Returns a pseudo-random number in the half-open interval [0.0, 1.0). Read More »
math.Round VALUE ⟼ float64Returns the nearest integer, rounding half away from zero. Read More »
math.Sin VALUE ⟼ float64Returns the sine of the given radian number. Read More »
math.Sqrt VALUE ⟼ float64Returns the square root of the given number. Read More »
math.Sub VALUE VALUE... ⟼ anySubtracts one or more numbers from the first number. Read More »
math.Sum VALUE... ⟼ float64Returns the sum of all numbers. Accepts scalars, slices, or both. Read More »
math.Tan VALUE ⟼ float64Returns the tangent of the given radian number. Read More »
math.ToDegrees VALUE ⟼ float64ToDegrees converts radians into degrees. Read More »
math.ToRadians VALUE ⟼ float64ToRadians converts degrees into radians. Read More »