fma
pub fn fma(x f64, y f64, z f64) f64Purpose
fma; returns f64.
Parameters
xf64- value (f64)
yf64- value (f64)
zf64- z (f64)
Returns
f64 — a value of this type
API
#mathCommon real functions plus Pi/E. pow is integer exponent; pow_f64 is floating power.
fmapub fn fma(x f64, y f64, z f64) f64fma; returns f64.
x f64y f64z f64f64 — a value of this type
abspub fn abs(x f64) f64Absolute value.
x f64f64 — a value of this type
minpub fn min(a f64, b f64) f64Minimum.
a f64b f64f64 — a value of this type
maxpub fn max(a f64, b f64) f64Maximum.
a f64b f64f64 — a value of this type
floorpub fn floor(x f64) f64Floor.
x f64f64 — a value of this type
ceilpub fn ceil(x f64) f64Ceiling.
x f64f64 — a value of this type
sqrtpub fn sqrt(x f64) f64Square root.
x f64f64 — a value of this type
powpub fn pow(x f64, n int) f64Power.
x f64n intf64 — a value of this type
exppub fn exp(x f64) f64e to the power.
x f64f64 — a value of this type
logpub fn log(x f64) f64Natural logarithm.
x f64f64 — a value of this type
hypotpub fn hypot(a f64, b f64) f64hypot; returns f64.
a f64b f64f64 — a value of this type
pipub fn pi() f64pi; returns f64.
none
f64 — a value of this type
epub fn e() f64e; returns f64.
none
f64 — a value of this type
ln2pub fn ln2() f64ln2; returns f64.
none
f64 — a value of this type
is_nanpub fn is_nan(x f64) boolWhether the value is NaN.
x f64bool — true or false
struct Frexppub struct Frexp {
pub frac f64
pub exp int
}Public struct `Frexp`.
frac f64exp intldexppub fn ldexp(frac f64, exp int) f64ldexp; returns f64.
frac f64exp intf64 — a value of this type
frexppub fn frexp(x f64) Frexpfrexp; returns Frexp.
x f64Frexp — a value of this type
dimpub fn dim(x f64, y f64) f64dim; returns f64.
x f64y f64f64 — a value of this type
remainderpub fn remainder(x f64, y f64) f64remainder; returns f64.
x f64y f64f64 — a value of this type
is_infpub fn is_inf(x f64) boolWhether the value is infinity.
x f64bool — true or false
copysignpub fn copysign(mag f64, sign f64) f64copysign; returns f64.
mag f64sign f64f64 — a value of this type
truncpub fn trunc(x f64) f64trunc; returns f64.
x f64f64 — a value of this type
modpub fn mod(x f64, y f64) f64Modulo.
x f64y f64f64 — a value of this type
roundpub fn round(x f64) f64round; returns f64.
x f64f64 — a value of this type
round_to_evenpub fn round_to_even(x f64) f64Round to even.
x f64f64 — a value of this type
sinpub fn sin(x f64) f64Sine.
x f64f64 — a value of this type
cospub fn cos(x f64) f64Cosine.
x f64f64 — a value of this type
tanpub fn tan(x f64) f64Tangent.
x f64f64 — a value of this type
atanpub fn atan(x f64) f64atan; returns f64.
x f64f64 — a value of this type
atan2pub fn atan2(y f64, x f64) f64atan2; returns f64.
y f64x f64f64 — a value of this type
nanpub fn nan() f64nan; returns f64.
none
f64 — a value of this type
infpub fn inf(sign int) f64inf; returns f64.
sign intf64 — a value of this type
signbitpub fn signbit(x f64) boolsignbit; returns bool.
x f64bool — true or false
pow_f64pub fn pow_f64(x f64, y f64) f64pow_f64 is math.Pow. The existing pow(x, n int) stays because Xu has no overloads (same split as cmp.less_int / less_f64).
x f64y f64f64 — a value of this type
log10pub fn log10(x f64) f64log10; returns f64.
x f64f64 — a value of this type
log2pub fn log2(x f64) f64log2; returns f64.
x f64f64 — a value of this type
exp2pub fn exp2(x f64) f64exp2; returns f64.
x f64f64 — a value of this type
cbrtpub fn cbrt(x f64) f64cbrt; returns f64.
x f64f64 — a value of this type
asinpub fn asin(x f64) f64asin; returns f64.
x f64f64 — a value of this type
acospub fn acos(x f64) f64acos; returns f64.
x f64f64 — a value of this type
struct ModfResultpub struct ModfResult {
pub intg f64
pub frac f64
}Public struct `ModfResult`.
intg f64frac f64sinhpub fn sinh(x f64) f64sinh; returns f64.
x f64f64 — a value of this type
coshpub fn cosh(x f64) f64cosh; returns f64.
x f64f64 — a value of this type
tanhpub fn tanh(x f64) f64tanh; returns f64.
x f64f64 — a value of this type
asinhpub fn asinh(x f64) f64Inverse hyperbolic functions ( Asinh/Acosh/Atanh). Combined from log/sqrt like sinh/cosh/tanh; large |x| uses log(2*|x|) so x*x does not overflow to Inf.
x f64f64 — a value of this type
acoshpub fn acosh(x f64) f64acosh; returns f64.
x f64f64 — a value of this type
atanhpub fn atanh(x f64) f64atanh; returns f64.
x f64f64 — a value of this type
modfpub fn modf(x f64) ModfResultmodf; returns ModfResult.
x f64ModfResult — a value of this type
log1ppub fn log1p(x f64) f64log1p is Log1p: ln(1+x). Small |x| returns x so 1+x does not round away the addend.
x f64f64 — a value of this type
expm1pub fn expm1(x f64) f64expm1 is Expm1: e^x - 1. Small |x| returns x so exp(x)-1 does not collapse to 0.
x f64f64 — a value of this type