SPVM::Math - Math Functions
The SPVM::Math module depends on the SPVM module. The SPVM module is yet before 1.0 released. The beta tests are doing. There will be a little reasonable changes yet.
use Math; my $sin = Math->sin(Math->PI / 4);
use SPVM 'Math'; my $sin = SPVM::Math->sin(SPVM::Math->PI / 4);
The Math class defines mathmatical functions that contains C99 math functions.
Math
The list of class methods of Math class.
static method abs : int ($x : int);
Get the abusolute value of a int value.
static method acos : double ($x : double)
The binding to the acos function of C language. This function is declared in math.h.
acos
math.h
static method acosf : float ($x : float)
The binding to the acosf function of C language. This function is declared in math.h.
acosf
static method acosh : double ($x : double)
The binding to the acosh function of C language. This function is declared in math.h.
acosh
static method acoshf : float ($x : float)
The binding to the acoshf function of C language. This function is declared in math.h.
acoshf
static method asin : double ($x : double)
The binding to the asin function of C language. This function is declared in math.h.
asin
static method asinf : float ($x : float)
The binding to the asinf function of C language. This function is declared in math.h.
asinf
static method asinh : double ($x : double)
The binding to the asinh function of C language. This function is declared in math.h.
asinh
static method asinhf : float ($x : float)
The binding to the asinhf function of C language. This function is declared in math.h.
asinhf
static method atan : double ($x : double)
The binding to the atan function of C language. This function is declared in math.h.
atan
static method atan2 : double ($y : double, $x : double)
The binding to the atan2 function of C language. This function is declared in math.h.
atan2
static method atanf : float ($x : float)
The binding to the atanf function of C language. This function is declared in math.h.
atanf
static method atanh : double ($x : double)
The binding to the atanh function of C language. This function is declared in math.h.
atanh
static method atanhf : float ($x : float)
The binding to the atanhf function of C language. This function is declared in math.h.
atanhf
static method cabs : double ($z : Complex_2d)
The binding to the cabs function of C language. This function is declared in complex.h.
cabs
complex.h
static method cabsf : float ($z : Complex_2f)
The binding to the cabsf function of C language. This function is declared in complex.h.
cabsf
static method cacos : Complex_2d ($z : Complex_2d)
The binding to the cacos function of C language. This function is declared in complex.h.
cacos
static method cacosf : Complex_2f ($z : Complex_2f)
The binding to the cacosf function of C language. This function is declared in complex.h.
cacosf
static method cacosh : Complex_2d ($z : Complex_2d)
The binding to the cacosh function of C language. This function is declared in complex.h.
cacosh
static method cacoshf : Complex_2f ($z : Complex_2f)
The binding to the cacoshf function of C language. This function is declared in complex.h.
cacoshf
static method cadd : Complex_2d ($z1 : Complex_2d, $z2 : Complex_2d)
The binding to the cadd function of C language. This function is declared in complex.h.
cadd
static method caddf : Complex_2f ($z1 : Complex_2f, $z2 : Complex_2f)
The binding to the caddf function of C language. This function is declared in complex.h.
caddf
static method carg : double ($z : Complex_2d)
The binding to the carg function of C language. This function is declared in complex.h.
carg
static method cargf : float ($z : Complex_2f)
The binding to the cargf function of C language. This function is declared in complex.h.
cargf
static method casin : Complex_2d ($z : Complex_2d)
The binding to the casin function of C language. This function is declared in complex.h.
casin
static method casinf : Complex_2f ($z : Complex_2f)
The binding to the casinf function of C language. This function is declared in complex.h.
casinf
static method casinh : Complex_2d ($z : Complex_2d)
The binding to the casinh function of C language. This function is declared in complex.h.
casinh
static method casinhf : Complex_2f ($z : Complex_2f)
The binding to the casinhf function of C language. This function is declared in complex.h.
casinhf
static method catan : Complex_2d ($z : Complex_2d)
The binding to the catan function of C language. This function is declared in complex.h.
catan
static method catanf : Complex_2f ($z : Complex_2f)
The binding to the catanf function of C language. This function is declared in complex.h.
catanf
static method catanh : Complex_2d ($z : Complex_2d)
The binding to the catanh function of C language. This function is declared in complex.h.
catanh
static method catanhf : Complex_2f ($z : Complex_2f)
The binding to the catanhf function of C language. This function is declared in complex.h.
catanhf
static method cbrt : double ($x : double)
The binding to the cbrt function of C language. This function is declared in math.h.
cbrt
static method cbrtf : float ($x : float)
The binding to the cbrtf function of C language. This function is declared in math.h.
cbrtf
static method ccos : Complex_2d ($z : Complex_2d)
The binding to the ccos function of C language. This function is declared in complex.h.
ccos
static method ccosf : Complex_2f ($z : Complex_2f)
The binding to the ccosf function of C language. This function is declared in complex.h.
ccosf
static method ccosh : Complex_2d ($z : Complex_2d)
The binding to the ccosh function of C language. This function is declared in complex.h.
ccosh
static method ccoshf : Complex_2f ($z : Complex_2f)
The binding to the ccoshf function of C language. This function is declared in complex.h.
ccoshf
static method cdiv : Complex_2d ($z1 : Complex_2d, $z2 : Complex_2d)
double complex division.
static method cdivf : Complex_2f ($z1 : Complex_2f, $z2 : Complex_2f)
float complex division.
static method ceil : double ($x : double)
The binding to the ceil function of C language. This function is declared in math.h.
ceil
static method ceilf : float ($x : float)
The binding to the ceilf function of C language. This function is declared in math.h.
ceilf
static method cexp : Complex_2d ($z : Complex_2d)
The binding to the cexp function of C language. This function is declared in complex.h.
cexp
static method cexpf : Complex_2f ($z : Complex_2f)
The binding to the cexpf function of C language. This function is declared in complex.h.
cexpf
static method clog : Complex_2d ($z : Complex_2d)
The binding to the clog function of C language. This function is declared in complex.h.
clog
static method clogf : Complex_2f ($z : Complex_2f)
The binding to the clogf function of C language. This function is declared in complex.h.
clogf
static method cmul : Complex_2d ($z1 : Complex_2d, $z2 : Complex_2d)
double complex multiplication.
static method cmulf : Complex_2f ($z1 : Complex_2f, $z2 : Complex_2f)
float complex multiplication.
static method complex : Complex_2d ($x : double, $y : double)
Create double complex value. This value is defined in Complex_2d.
static method complexf : Complex_2f ($x : float, $y : float)
Create float complex value. This value is defined in Complex_2f.
static method conj : Complex_2d ($z : Complex_2d)
The binding to the conj function of C language. This function is declared in complex.h.
conj
static method conjf : Complex_2f ($z : Complex_2f)
The binding to the conjf function of C language. This function is declared in complex.h.
conjf
static method copysign : double ($x1 : double, $x2 : double)
The binding to the copysign function of C language. This function is declared in math.h.
copysign
static method copysignf : float ($x1 : float, $x2 : float)
The binding to the copysignf function of C language. This function is declared in math.h.
copysignf
static method cos : double ($x : double)
The binding to the cos function of C language. This function is declared in math.h.
cos
static method cosf : float ($x : float)
The binding to the cosf function of C language. This function is declared in math.h.
cosf
static method cosh : double ($x : double)
The binding to the cosh function of C language. This function is declared in math.h.
cosh
static method coshf : float ($x : float)
The binding to the coshf function of C language. This function is declared in math.h.
coshf
static method cpow : Complex_2d ($z1 : Complex_2d, $z2 : Complex_2d)
The binding to the cpow function of C language. This function is declared in complex.h.
cpow
static method cpowf : Complex_2f ($z1 : Complex_2f, $z2 : Complex_2f)
The binding to the cpowf function of C language. This function is declared in complex.h.
cpowf
static method cscamul : Complex_2d ($c : double, $z : Complex_2d)
double complex scalar multiplication.
static method cscamulf : Complex_2f ($c : float, $z : Complex_2f)
float complex scalar multiplication.
static method csin : Complex_2d ($z : Complex_2d)
The binding to the csin function of C language. This function is declared in complex.h.
csin
static method csinf : Complex_2f ($z : Complex_2f)
The binding to the csinf function of C language. This function is declared in complex.h.
csinf
static method csinh : Complex_2d ($z : Complex_2d)
The binding to the csinh function of C language. This function is declared in complex.h.
csinh
static method csinhf : Complex_2f ($z : Complex_2f)
The binding to the csinhf function of C language. This function is declared in complex.h.
csinhf
static method csqrt : Complex_2d ($z : Complex_2d)
The binding to the csqrt function of C language. This function is declared in complex.h.
csqrt
static method csqrtf : Complex_2f ($z : Complex_2f)
The binding to the csqrtf function of C language. This function is declared in complex.h.
csqrtf
static method csub : Complex_2d ($z1 : Complex_2d, $z2 : Complex_2d)
The binding to the csub function of C language. This function is declared in complex.h.
csub
static method csubf : Complex_2f ($z1 : Complex_2f, $z2 : Complex_2f)
The binding to the csubf function of C language. This function is declared in complex.h.
csubf
static method ctan : Complex_2d ($z : Complex_2d)
The binding to the ctan function of C language. This function is declared in complex.h.
ctan
static method ctanf : Complex_2f ($z : Complex_2f)
The binding to the ctanf function of C language. This function is declared in complex.h.
ctanf
static method ctanh : Complex_2d ($z : Complex_2d)
The binding to the ctanh function of C language. This function is declared in complex.h.
ctanh
static method ctanhf : Complex_2f ($z : Complex_2f)
The binding to the ctanhf function of C language. This function is declared in complex.h.
ctanhf
static method E : double ()
Euler's Number e. This value is 0x1.5bf0a8b145769p+1.
0x1.5bf0a8b145769p+1
static method erf : double ($x : double)
The binding to the erf function of C language. This function is declared in math.h.
erf
static method erfc : double ($x : double)
The binding to the erfc function of C language. This function is declared in math.h.
erfc
static method erfcf : float ($x : float)
The binding to the erfcf function of C language. This function is declared in math.h.
erfcf
static method erff : float ($x : float)
The binding to the erff function of C language. This function is declared in math.h.
erff
static method exp : double ($x : double)
The binding to the exp function of C language. This function is declared in math.h.
exp
static method exp2 : double ($x : double)
The binding to the exp2 function of C language. This function is declared in math.h.
exp2
static method exp2f : float ($x : float)
The binding to the exp2f function of C language. This function is declared in math.h.
exp2f
static method expf : float ($x : float)
The binding to the expf function of C language. This function is declared in math.h.
expf
static method expm1 : double ($x : double)
The binding to the expm1 function of C language. This function is declared in math.h.
expm1
static method expm1f : float ($x : float)
The binding to the expm1f function of C language. This function is declared in math.h.
expm1f
static method fabs : double ($x : double)
The binding to the fabs function of C language. This function is declared in math.h.
fabs
static method fabsf : float ($x : float)
The binding to the fabsf function of C language. This function is declared in math.h.
fabsf
static method fdim : double ($x1 : double, $x2 : double)
The binding to the fdim function of C language. This function is declared in math.h.
fdim
static method fdimf : float ($x1 : float, $x2 : float)
The binding to the fdimf function of C language. This function is declared in math.h.
fdimf
static method FE_DOWNWARD : int ()
The binding to the FE_DOWNWARD macro of C language. This macro is defined in fenv.h.
FE_DOWNWARD
static method FE_TONEAREST : int ()
The binding to the FE_TONEAREST macro of C language. This macro is defined in fenv.h.
FE_TONEAREST
static method FE_TOWARDZERO : int ()
The binding to the FE_TOWARDZERO macro of C language. This macro is defined in fenv.h.
FE_TOWARDZERO
static method FE_UPWARD : int ()
The binding to the FE_UPWARD macro of C language. This macro is defined in fenv.h.
FE_UPWARD
static method fesetround : int ($round : int)
The binding to the fesetround function of C language. This function is declared in math.h.
fesetround
static method floor : double ($x : double)
The binding to the floor function of C language. This function is declared in math.h.
floor
static method floorf : float ($x : float)
The binding to the floorf function of C language. This function is declared in math.h.
floorf
static method fma : double ($x1 : double, $x2 : double, $x3 : double)
The binding to the fma function of C language. This function is declared in math.h.
fma
static method fmaf : float ($x1 : float, $x2 : float, $x3 : float)
The binding to the fmaf function of C language. This function is declared in math.h.
fmaf
static method fmax : double ($x1 : double, $x2 : double)
The binding to the fmax function of C language. This function is declared in math.h.
fmax
static method fmaxf : float ($x1 : float, $x2 : float)
The binding to the fmaxf function of C language. This function is declared in math.h.
fmaxf
static method fmin : double ($x1 : double, $x2 : double)
The binding to the fmin function of C language. This function is declared in math.h.
fmin
static method fminf : float ($x1 : float, $x2 : float)
The binding to the fminf function of C language. This function is declared in math.h.
fminf
static method fmod : double ($x1 : double, $x2 : double)
The binding to the fmod function of C language. This function is declared in math.h.
fmod
static method fmodf : float ($x1 : float, $x2 : float)
The binding to the fmodf function of C language. This function is declared in math.h.
fmodf
static method FP_ILOGB0 : int ()
The binding to the FP_ILOGB0 macro of C language. This macro is defined in fenv.h.
FP_ILOGB0
static method FP_ILOGBNAN : int ()
The binding to the FP_ILOGBNAN macro of C language. This macro is defined in fenv.h.
FP_ILOGBNAN
static method FP_INFINITE : int ()
The binding to the FP_INFINITE macro of C language. This macro is defined in fenv.h.
FP_INFINITE
static method FP_NAN : int ()
The binding to the FP_NAN macro of C language. This macro is defined in fenv.h.
FP_NAN
static method FP_ZERO : int ()
The binding to the FP_ZERO macro of C language. This macro is defined in fenv.h.
FP_ZERO
static method fpclassify : int ($x : double)
The binding to the fpclassify macro of C language. This macro is defined in math.h. This method receives a double value.
fpclassify
static method fpclassifyf : int ($x : float)
The binding to the fpclassify macro of C language. This macro is defined in math.h for float type. This method receives a float value.
static method frexp : double ($x : double, $exp : int*)
The binding to the frexp function of C language. This function is declared in math.h.
frexp
static method frexpf : float ($x : float, $exp : int*)
The binding to the frexpf function of C language. This function is declared in math.h.
frexpf
static method HUGE_VAL : double ()
The binding to the HUGE_VAL macro of C language. This macro is defined in math.h.
HUGE_VAL
static method HUGE_VALF : float ()
The binding to the HUGE_VALF macro of C language. This macro is defined in math.h.
HUGE_VALF
static method hypot : double ($x : double, $y : double)
The binding to the hypot function of C language. This function is declared in math.h.
hypot
static method hypotf : float ($x : float, $y : float)
The binding to the hypotf function of C language. This function is declared in math.h.
hypotf
static method ilogb : int ($x : double)
The binding to the ilogb function of C language. This function is declared in math.h.
ilogb
static method ilogbf : int ($x : float)
The binding to the ilogbf function of C language. This function is declared in math.h.
ilogbf
static method INFINITY : double ()
The binding to the INFINITY macro of C language. This macro is defined in math.h. This method returns a double value.
INFINITY
static method INFINITYF : float ()
INFINITY macro for float type defined in C language math.h. This method returns a float value.
static method isfinite : int ($x : double)
The binding to the isfinite macro of C language. This macro is defined in math.h. This method receives a double value.
isfinite
static method isfinitef : int($x : float)
The binding to the isfinite macro of C language. This macro is defined in math.h for float type. This method receives a float value.
static method isgreater : int ($x1 : double, $x2 : double)
The binding to the isgreater macro of C language. This macro is defined in math.h. This method receives two double values.
isgreater
static method isgreaterequal : int ($x1 : double, $x2 : double)
The binding to the isgreaterequal macro of C language. This macro is defined in math.h. This method receives two double values.
isgreaterequal
static method isgreaterequalf : int ($x1 : float, $x2 : float)
The binding to the isgreaterequal macro of C language. This macro is defined in math.h. This method receives two float values.
static method isgreaterf : int ($x1 : float, $x2 : float)
The binding to the isgreater macro of C language. This macro is defined in math.h. This method receives two float values.
static method isinf : int ($x : double)
The binding to the isinf macro of C language. This macro is defined in math.h. This method receives a double value.
isinf
static method isinff : int($x : float)
The binding to the isinf macro of C language. This macro is defined in math.h. This method receives a float value.
static method isless : int ($x1 : double, $x2 : double)
The binding to the isless macro of C language. This macro is defined in math.h. This method receives two double values.
isless
static method islessequal : int ($x1 : double, $x2 : double)
The binding to the islessequal macro of C language. This macro is defined in math.h. This method receives two double values.
islessequal
static method islessequalf : int ($x1 : float, $x2 : float)
The binding to the islessequalf macro of C language. This macro is defined in math.h. This method receives two float values.
islessequalf
static method islessf : int ($x1 : float, $x2 : float)
The binding to the islessf macro of C language. This macro is defined in math.h. This method receives two float values.
islessf
static method islessgreater : int ($x1 : double, $x2 : double)
The binding to the islessgreater macro of C language. This macro is defined in math.h. This method receives two double values.
islessgreater
static method islessgreaterf : int ($x1 : float, $x2 : float)
The binding to the islessgreater macro of C language. This macro is defined in math.h. This method receives two float values.
static method isnan : int ($x : double)
The binding to the isnan macro of C language. This macro is defined in math.h. This method receives a double value.
isnan
static method isnanf : int ($x : float)
The binding to the isnanf macro of C language. This macro is defined in math.h. This method receives a float value.
isnanf
static method isunordered : int ($x1 : double, $x2 : double)
The binding to the isunordered macro of C language. This macro is defined in math.h. This method receives two double values.
isunordered
static method isunorderedf : int ($x1 : float, $x2 : float)
The binding to the isunorderedf macro of C language. This macro is defined in math.h. This method receives two float values.
isunorderedf
static method labs : long ($x : long);
Get the abusolute value of a long value.
static method ldexp : double ($x : double, $exp : int)
The binding to the ldexp function of C language. This function is declared in math.h.
ldexp
static method ldexpf : float ($x : float, $exp : int)
The binding to the ldexpf function of C language. This function is declared in math.h.
ldexpf
static method lgamma : double ($x : double)
The binding to the lgamma function of C language. This function is declared in math.h.
lgamma
static method lgammaf : float ($x : float)
The binding to the lgammaf function of C language. This function is declared in math.h.
lgammaf
static method log : double ($x : double)
The binding to the log function of C language. This function is declared in math.h.
log
static method log10 : double ($x : double)
The binding to the log10 function of C language. This function is declared in math.h.
log10
static method log10f : float ($x : float)
The binding to the log10f function of C language. This function is declared in math.h.
log10f
static method log1p : double ($x : double)
The binding to the log1p function of C language. This function is declared in math.h.
log1p
static method log1pf : float ($x : float)
The binding to the log1pf function of C language. This function is declared in math.h.
log1pf
static method log2 : double ($x : double)
The binding to the log2 function of C language. This function is declared in math.h.
log2
static method log2f : float ($x : float)
The binding to the log2f function of C language. This function is declared in math.h.
log2f
static method logb : double ($x : double)
The binding to the logb function of C language. This function is declared in math.h.
logb
static method logbf : float ($x : float)
The binding to the logbf function of C language. This function is declared in math.h.
logbf
static method logf : float ($x : float)
The binding to the logf function of C language. This function is declared in math.h.
logf
static method lround : long ($x : double)
The binding to the llround function of C language. This function is declared in math.h. Note that call llround instead of lround in C level.
llround
static method lroundf : long ($x : float)
The binding to the llroundf function of C language. This function is declared in math.h. Note that call llroundf instead of lroundf in C level.
llroundf
static method modf : double ($x : double, $intpart : double*)
The binding to the modf function of C language. This function is declared in math.h.
modf
static method modff : float ($x : float, $intpart : float*)
The binding to the modff function of C language. This function is declared in math.h.
modff
static method NAN : double ()
The binding to the NAN macro of C language. This macro is defined in math.h. This method return a double value.
NAN
static method nan : double ($str : string)
The binding to the nan function of C language. This function is declared in math.h.
nan
String must be defined, otherwise a exception occurs.
static method NANF : float ()
The binding to the NAN macro of C language. This macro is defined in math.h. This method return a float value.
static method nanf : float ($str : string)
The binding to the nanf function of C language. This function is declared in math.h.
nanf
static method nearbyint : double ($x : double)
The binding to the nearbyint function of C language. This function is declared in math.h.
nearbyint
static method nearbyintf : float ($x : float)
The binding to the nearbyintf function of C language. This function is declared in math.h.
nearbyintf
static method nextafter : double ($x1 : double, $x2 : double)
The binding to the nextafter function of C language. This function is declared in math.h.
nextafter
static method nextafterf : float ($x1 : float, $x2 : float)
The binding to the nextafterf function of C language. This function is declared in math.h.
nextafterf
static method nexttoward : double ($x1 : double, $x2 : double)
The binding to the nexttoward function of C language. This function is declared in math.h.
nexttoward
static method nexttowardf : float ($x1 : float, $x2 : double)
The binding to the nexttowardf function of C language. This function is declared in math.h.
nexttowardf
static method PI : double ()
pi. This value is 0x1.921fb54442d18p+1.
static method pow : double ($x : double, $y : double)
The binding to the pow function of C language. This function is declared in math.h.
pow
static method powf : float ($x : float, $y : float)
The binding to the powf function of C language. This function is declared in math.h.
powf
static method remainder : double ($x1 : double, $x2 : double)
The binding to the remainder function of C language. This function is declared in math.h.
remainder
static method remainderf : float ($x1 : float, $x2 : float)
The binding to the remainderf function of C language. This function is declared in math.h.
remainderf
static method remquo : double ($x1 : double, $x2 : double, $quo : int*)
The binding to the remquo function of C language. This function is declared in math.h.
remquo
static method remquof : float ($x1 : float, $x2 : float, $quo : int*)
The binding to the remquof function of C language. This function is declared in math.h.
remquof
static method round : double ($x : double)
The binding to the round function of C language. This function is declared in math.h.
round
static method roundf : float ($x : float)
The binding to the roundf function of C language. This function is declared in math.h.
roundf
static method scalbln : double ($x : double, $exp : long)
The binding to the scalbln function of C language. This function is declared in math.h.
scalbln
static method scalblnf : float ($x : float, $exp : long)
The binding to the scalblnf function of C language. This function is declared in math.h.
scalblnf
static method scalbn : double ($x : double, $exp : int)
The binding to the scalbn function of C language. This function is declared in math.h.
scalbn
static method scalbnf : float ($x : float, $exp : int)
The binding to the scalbnf function of C language. This function is declared in math.h.
scalbnf
static method signbit : int ($x : double)
The binding to the signbit function of C language. This function is declared in math.h.
signbit
static method signbitf : int ($x : float)
The binding to the signbitf function of C language. This function is declared in math.h.
signbitf
static method sin : double ($x : double)
The binding to the sin function of C language. This function is declared in math.h.
sin
static method sinf : float ($x : float)
The binding to the sinf function of C language. This function is declared in math.h.
sinf
static method sinh : double ($x : double)
The binding to the sinh function of C language. This function is declared in math.h.
sinh
static method sinhf : float ($x : float)
The binding to the sinhf function of C language. This function is declared in math.h.
sinhf
static method sqrt : double ($x : double)
The binding to the sqrt function of C language. This function is declared in math.h.
sqrt
The binding to the sqrtf function of C language. This function is declared in math.h.
sqrtf
static method tan : double ($x : double)
The binding to the tan function of C language. This function is declared in math.h.
tan
static method tanf : float ($x : float)
The binding to the tanf function of C language. This function is declared in math.h.
tanf
static method tanh : double ($x : double)
The binding to the tanh function of C language. This function is declared in math.h.
tanh
static method tanhf : float ($x : float)
The binding to the tanhf function of C language. This function is declared in math.h.
tanhf
static method tgamma : double ($x : double)
The binding to the tgamma function of C language. This function is declared in math.h.
tgamma
static method tgammaf : float ($x : float)
The binding to the tgammaf function of C language. This function is declared in math.h.
tgammaf
static method trunc : double ($x : double)
The binding to the trunc function of C language. This function is declared in math.h.
trunc
static method truncf : float ($x : float)
The binding to the truncf function of C language. This function is declared in math.h.
truncf
To install SPVM::Math, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SPVM::Math
CPAN shell
perl -MCPAN -e shell install SPVM::Math
For more information on module installation, please visit the detailed CPAN module installation guide.