math

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 4 Imported by: 1

README

Math library

Go Report Card codecov

Candidate functions:

Func Name Prototype Description
Abs Abs(x float) float {} Returns the absolute value of x
Acos Acos(x float) float {} Returns arc cosine of x
Acosh Acosh(x float) float {} Returns arc hyperbolic cosine of x
Asin Asin(x float) float {} Returns arc sine of x
Asinh Asinh(x float) float {} Returns arc hyperbolic sine of x
Atan Atan(x float) float {} Returns arc tangent of x
Atanh Atanh(x float) float {} Returns arc hyperbolic tangent of x
Cbrt Cbrt(x float) float {} Returns the cubic root of x
Ceil Ceil(x float) float {} Returns the least integer that it's bigger or equal to x
Cos Cos(x float) float {} Returns adjacent / hypotenuse
Cosh Cosh(x float) float {} Returns hyperbolic cosine of x
DegreesToRadians DegreesToRadians(x float) float {} Returns x value in degrees to radians
Exp Exp(x float) float {} Returns e^x (exponential)
Fact Fact(x float) float {} Returns the factorial number of x
Floor Floor(x float) float {} Returns the greatest integer which is smaller or equal to x
Ln Ln(x float) float {} Returns the naturel logarithm of x
Log10 Log10(x float) float {} Returns base-10 logarithm of x
Max Max(x float, y float) float {} Returns the larger number between x and y
Min Min(x float, y float) float {} Returns the smaller number between x and y
Modulo Modulo(x float, y float) float {} Returns remainder of x / y
Pi Pi() float {} Returns Pi (3.14 ...etc)
Pow Pow(x float, y float) float, error {} Returns x^y
Pow Pow(x int, y float) float, error {} Returns x^y
Pow Pow(x float, y float) float, error {} Returns x^y
RadiansToDegrees RadiansToDegrees(x float) float {} Returns x value in radians to degrees
Random Random(x float, y float) float {} Returns random number between x and y
Round Round(x float) float {} Returns x rounded to the nearest int
Sin Sin(x float) float {} Returns opposite / hypotenuse
Sinh Sinh(x float) float {} Returns hyperbolic sine of x
Sqrt Sqrt(x float) float {} Returns the square root of x
Tan Tan(x float) float {} Returns opposite / adjacent
Tanh Tanh(x float) float {} Returns hyperbolic tangent of x
Trunc Trunc(x float) float {} Returns the integer value of x

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(x float64) float64

Abs returns the value of the absolute value of a number

func Acos

func Acos(x float64) float64

Acos returns the value of the arc cosine of a number

func Acosh

func Acosh(x float64) float64

Acosh returns the value of the arc hyperbolic cosine of a number

func Asin

func Asin(x float64) float64

Asin returns the value of the arc sine of a number

func Asinh

func Asinh(x float64) float64

Asinh returns the value of the arc hyperbolic sine of a number

func Atan

func Atan(x float64) float64

Atan returns the value of the arc tangent of a number

func Atanh

func Atanh(x float64) float64

Atanh returns the value of the arc hyperbolic tangent of a number

func Cbrt

func Cbrt(x float64) float64

Cbrt returns the value of the cube root of a number

func Ceil

func Ceil(x float64) float64

Ceil returns the value of the ceiling of a number

func Cos

func Cos(x float64) float64

Cos returns the value of cosinus of an angle

func Cosh

func Cosh(x float64) float64

Cosh returns the value of the hyperbolic cosine of a number

func DegreesToRadians

func DegreesToRadians(x float64) float64

DegreesToRadians converts degrees to radians.

func Exp

func Exp(x float64) float64

Exp returns the value of the exponential of a number

func Fact

func Fact(x float64) float64

Fact returns the value of the factorial of a number

func Floor

func Floor(x float64) float64

Floor returns the value of the floor of a number

func Ln

func Ln(x float64) float64

Ln returns the value of the natural logarithm of a number

func Log10

func Log10(x float64) float64

Log10 returns the base-10 logarithm of a number.

func Max

func Max(x float64, y float64) float64

Max returns the value of the maximum of two numbers

func Min

func Min(x float64, y float64) float64

Min returns the value of the minimum of two numbers

func Modulo

func Modulo(x, y float64) float64

Modulo returns the remainder of a division operation.

func Pi

func Pi() float64

Pi returns the value of PI

func Pow

func Pow(x any, y any) (float64, error)

Pow returns the value of the power of a number

func RadiansToDegrees

func RadiansToDegrees(x float64) float64

RadiansToDegrees converts radians to degrees.

func Random

func Random(x, y float64) float64

Random generates a random number between a given range.

func Round

func Round(x float64) float64

Round rounds a number to the nearest integer.

func Sin

func Sin(x float64) float64

Sin returns the value of sinus of an angle

func Sinh

func Sinh(x float64) float64

Sinh returns the value of the hyperbolic sine of a number

func Sqrt

func Sqrt(x float64) float64

Sqrt returns the value of the square root of a number

func Tan

func Tan(x float64) float64

Tan returns the value of the tangent of an angle

func Tanh

func Tanh(x float64) float64

Tanh returns the value of the hyperbolic tangent of a number

func Trunc

func Trunc(x float64) float64

Trunc returns the value of the trunc of a number

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL