Examples using... "math"

Recent
Float64s sorts a slice of float64s in increasing order (not-a-number values are treated as less than other values).
Tanh returns the hyperbolic tangent of x.
Tan returns the tangent of the radian argument x.
Sqrt returns the square root of x.
Sinh returns the hyperbolic sine of x.
Sincos returns Sin(x), Cos(x).
Sin returns the sine of the radian argument x.
RoundToEven returns the nearest integer, rounding ties to even.
Round returns the nearest integer, rounding half away from zero.
Pow10 returns 10**n, the base-10 exponential of n.
Pow returns x**y, the base-x exponential of y.
Mod returns the floating-point remainder of x/y. The magnitude of the result is less than y and its sign agrees with that of x.
Log2 returns the binary logarithm of x. The special cases are the same as for Log.
Log10 returns the decimal logarithm of x. The special cases are the same as for Log.
Log returns the natural logarithm of x.
Floor returns the greatest integer value less than or equal to x.
Cosh returns the hyperbolic cosine of x.
Cos returns the cosine of the radian argument x.
Ceil returns the least integer value greater than or equal to x.
Atanh returns the inverse hyperbolic tangent of x.
Atan2 returns the arc tangent of y/x, using the signs of the two to determine the quadrant of the return value.
Atan returns the arctangent, in radians, of x.
Asinh returns the inverse hyperbolic sine of x.
Asin returns the arcsine, in radians, of x.
Acosh returns the inverse hyperbolic cosine of x.
Acos returns the arccosine, in radians, of x.
Abs returns the absolute value of x.
Polar returns the absolute value r and phase θ of x, such that x = r * e**θi. The phase is in the range [-Pi, Pi].
ExampleExp computes Euler's identity.
This example shows how to use big.Float to compute the square root of 2 with a precision of 200 bits, and how to print the result as a decimal number.