-
Notifications
You must be signed in to change notification settings - Fork 4
The math library
The math package implements basic math functions for the float type.
Returns the absolute value of x.
Returns the inverse cosine of x.
Returns the inverse hyperbolic cosine of x.
Returns the inverse sine of x.
Returns the inverse hyperbolic sine of x.
Returns the inverse tangent of x.
Returns the inverse tangent of y/x, using the signs of the two to determine the quadrant of the return value.
Returns the inverse hyperbolic tangent of x.
Returns the cube root of x.
Returns the ceiling of x.
Returns the sign of x.
Returns the cosine of x.
Returns the hyperbolic cosine of x.
Returns the the maximum of x - y or 0.
Returns the error function of x.
Returns the complementary error function of x.
Returns the inverse of erfc(x).
Returns the inverse of erv(x).
Returns the base-e exponential of x.
Returns the base-2 exponential of x.
Returns the base-e exponential of x, minus 1. It is more accurate than exp(x) - 1 when x is near zero.
Returns x * y + z, computed with only one rounding. (That is, FMA returns the fused multiply-add of x, y, and z.)
Returns the floor of x.
frexp breaks x into a normalized fraction and an integral power of two, such that if frac, exp = frexp(x) then x == frac × 2^exp, with the absolute value of frac in the interval [½, 1).
Returns the Gamma function of x.
Returns sqrt(p*p + q*q), taking care to avoid unnecessary overflow and underflow.
Returns positive infinity if sign >= 0, negative infinity if sign < 0.
Tests whether f is an infinity, according to sign. If sign > 0, isInf reports whether f is positive infinity. If sign < 0, isInf reports whether f is negative infinity. If sign == 0, isInf reports whether f is either infinity.
Tests whether x is naN.
Returns the order-zero Bessel function of the first kind.
Returns the order-one Bessel function of the first kind.
Returns the order-n Bessel function of the first kind.
The inverse of frexp: it returns frac * 2^exp.
Returns the natural logarithm and sign (-1 or +1) of gamma(x).
Returns the natural logarithm of x.
Returns the base-10 logarithm of x.
Returns the natural logarithm of 1 + x. It is more accurate than log(1 + x) when x is near zero.
Returns the base-2 logarithm of x.
Returns the base-2 exponent of x.
Returns the larger of x and y.
Returns the smaller of x and y.
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.
Returns integer and fractional floating-point numbers that sum to x. Both values have the same sign as x.
Returns the next representable float value after x towards y.
Returns x^y.
Returns 10^x.
Returns the IEEE 754 floating-point remainder of x/y.
Returns the nearest integer to x as a float, rounding o.5 away from zero.
Returns the nearest integer to x, rounding ties to the even integer.
Tests whether x is negative, or negative zero
Returns the sin of x.
Returns the sine and the cosine of x.
Returns the hyperbolic sine of x.
Returns the square root of x.
Returns the tangent of x.
Returns the hyperbolic tangent of x.
Returns the integer part of x, as a float.
Returns the order-zero Bessel function of the second kind.
Returns the order-one Bessel function of the second kind.
Returns the order-n Bessel function of the second kind.
This page is automatically generated from the Pipefish standard library. Any edits made directly to this wiki page will be overwritten the next time the documentation is regenerated.
🧿 Pipefish is distributed under the MIT license. Please steal my code and ideas.
- Getting started
- Language basics
- The type system and built-in functions
- Functional Pipefish
- Encapsulation
- Imperative Pipefish
-
Imports and libraries
- The crypto/aes library
- The crypto/bcrypt library
- The crypto/rand library
- The crypto/rsa library
- The crypto/sha_256 library
- The crypto/sha_512 library
- The database/sql library
- The encoding/base_32 library
- The encoding/base_64 library
- The encoding/csv library
- The encoding/json library
- The files library
- The fmt library
- The html library
- The image library
- The image/bmp library
- The image/color library
- The image/jpeg library
- The image/png library
- The lists library
- The markdown library
- The math library
- The math/big library
- The math/cmplx library
- The math/rand library
- The net/http library
- The net/mail library
- The net/smtp library
- The net/url library
- The os/exec library
- The path library
- The path/filepath library
- The reflect library
- The regexp library
- The strconv library
- The strings library
- The terminal library
- The time library
- The unicode library
- Advanced Pipefish
- Developing in Pipefish
- Deployment
- Appendices