PHP 클래스 Neos\Eel\Helper\MathHelper

The implementation sticks to the JavaScript specificiation including EcmaScript 6 proposals. See https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Math for a documentation and specification of the JavaScript implementation.
상속: implements Neos\Eel\ProtectedContextAwareInterface
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

공개 메소드들

메소드 설명
abs ( float $x = 'NAN' ) : float
acos ( float $x ) : float
acosh ( float $x ) : float
allowsCallOfMethod ( string $methodName ) : boolean All methods are considered safe
asin ( float $x ) : float
asinh ( float $x ) : float
atan ( float $x ) : float
atan2 ( float $y, float $x ) : float
atanh ( float $x ) : float
cbrt ( float $x ) : float
ceil ( float $x ) : float
cos ( float $x ) : float
cosh ( float $x ) : float
exp ( float $x ) : float
expm1 ( float $x ) : float
floor ( float $x ) : float
getE ( ) : float
getLN10 ( ) : float
getLN2 ( ) : float
getLOG10E ( ) : float
getLOG2E ( ) : float
getPI ( ) : float
getSQRT1_2 ( ) : float
getSQRT2 ( ) : float
hypot ( float $x, float $y, float $z_ = null ) : float
isFinite ( mixed $x ) : boolean Test if the given value is a finite number
isInfinite ( mixed $x ) : boolean Test if the given value is an infinite number (INF or -INF)
isNaN ( mixed $x ) : boolean Test if the given value is not a number (either not numeric or NAN)
log ( float $x ) : float
log10 ( float $x ) : float
log1p ( float $x ) : float
log2 ( float $x ) : float
max ( float $x = null, float $y_ = null ) : float
min ( float $x = null, float $y_ = null ) : float
pow ( float $x, float $y ) : float Calculate the power of x by y
random ( ) : float Get a random foating point number between 0 (inclusive) and 1 (exclusive)
randomInt ( integer $min, integer $max ) : integer Get a random integer number between a min and max value (inclusive)
round ( float $subject, integer $precision ) : float Rounds the subject to the given precision
sign ( integer | float $x ) : integer Get the sign of the given number, indicating whether the number is positive, negative or zero
sin ( float $x ) : float
sinh ( float $x ) : float
sqrt ( float $x ) : float
tan ( float $x ) : float
tanh ( float $x ) : float
trunc ( float $x ) : integer Get the integral part of the given number by removing any fractional digits

메소드 상세

abs() 공개 메소드

public abs ( float $x = 'NAN' ) : float
$x float A number
리턴 float The absolute value of the given value

acos() 공개 메소드

public acos ( float $x ) : float
$x float A number
리턴 float The arccosine (in radians) of the given value

acosh() 공개 메소드

public acosh ( float $x ) : float
$x float A number
리턴 float The hyperbolic arccosine (in radians) of the given value

allowsCallOfMethod() 공개 메소드

All methods are considered safe
public allowsCallOfMethod ( string $methodName ) : boolean
$methodName string
리턴 boolean

asin() 공개 메소드

public asin ( float $x ) : float
$x float A number
리턴 float The arcsine (in radians) of the given value

asinh() 공개 메소드

public asinh ( float $x ) : float
$x float A number
리턴 float The hyperbolic arcsine (in radians) of the given value

atan() 공개 메소드

public atan ( float $x ) : float
$x float A number
리턴 float The arctangent (in radians) of the given value

atan2() 공개 메소드

public atan2 ( float $y, float $x ) : float
$y float A number
$x float A number
리턴 float The arctangent of the quotient of its arguments

atanh() 공개 메소드

public atanh ( float $x ) : float
$x float A number
리턴 float The hyperbolic arctangent (in radians) of the given value

cbrt() 공개 메소드

public cbrt ( float $x ) : float
$x float A number
리턴 float The cube root of the given value

ceil() 공개 메소드

public ceil ( float $x ) : float
$x float A number
리턴 float The smallest integer greater than or equal to the given value

cos() 공개 메소드

public cos ( float $x ) : float
$x float A number given in radians
리턴 float The cosine of the given value

cosh() 공개 메소드

public cosh ( float $x ) : float
$x float A number
리턴 float The hyperbolic cosine of the given value

exp() 공개 메소드

public exp ( float $x ) : float
$x float A number
리턴 float The power of the Euler's constant with the given value (e^x)

expm1() 공개 메소드

public expm1 ( float $x ) : float
$x float A number
리턴 float The power of the Euler's constant with the given value minus 1 (e^x - 1)

floor() 공개 메소드

public floor ( float $x ) : float
$x float A number
리턴 float The largest integer less than or equal to the given value

getE() 공개 메소드

public getE ( ) : float
리턴 float Euler's constant and the base of natural logarithms, approximately 2.718

getLN10() 공개 메소드

public getLN10 ( ) : float
리턴 float Natural logarithm of 10, approximately 2.303

getLN2() 공개 메소드

public getLN2 ( ) : float
리턴 float Natural logarithm of 2, approximately 0.693

getLOG10E() 공개 메소드

public getLOG10E ( ) : float
리턴 float Base 10 logarithm of E, approximately 0.434

getLOG2E() 공개 메소드

public getLOG2E ( ) : float
리턴 float Base 2 logarithm of E, approximately 1.443

getPI() 공개 메소드

public getPI ( ) : float
리턴 float Ratio of the circumference of a circle to its diameter, approximately 3.14159

getSQRT1_2() 공개 메소드

public getSQRT1_2 ( ) : float
리턴 float Square root of 1/2; equivalently, 1 over the square root of 2, approximately 0.707

getSQRT2() 공개 메소드

public getSQRT2 ( ) : float
리턴 float Square root of 2, approximately 1.414

hypot() 공개 메소드

public hypot ( float $x, float $y, float $z_ = null ) : float
$x float A number
$y float A number
$z_ float Optional variable list of additional numbers
리턴 float The square root of the sum of squares of the arguments

isFinite() 공개 메소드

This is equivalent to the global isFinite() function in JavaScript.
public isFinite ( mixed $x ) : boolean
$x mixed A value
리턴 boolean TRUE if the value is a finite (not NAN) number

isInfinite() 공개 메소드

This function has no direct equivalent in JavaScript.
public isInfinite ( mixed $x ) : boolean
$x mixed A value
리턴 boolean TRUE if the value is INF or -INF

isNaN() 공개 메소드

This is equivalent to the global isNaN() function in JavaScript.
public isNaN ( mixed $x ) : boolean
$x mixed A value
리턴 boolean TRUE if the value is not a number

log() 공개 메소드

public log ( float $x ) : float
$x float A number
리턴 float The natural logarithm (base e) of the given value

log10() 공개 메소드

public log10 ( float $x ) : float
$x float A number
리턴 float The base 10 logarithm of the given value

log1p() 공개 메소드

public log1p ( float $x ) : float
$x float A number
리턴 float The natural logarithm (base e) of 1 + the given value

log2() 공개 메소드

public log2 ( float $x ) : float
$x float A number
리턴 float The base 2 logarithm of the given value

max() 공개 메소드

public max ( float $x = null, float $y_ = null ) : float
$x float A number
$y_ float Optional variable list of additional numbers
리턴 float The largest of the given numbers (zero or more)

min() 공개 메소드

public min ( float $x = null, float $y_ = null ) : float
$x float A number
$y_ float Optional variable list of additional numbers
리턴 float The smallest of the given numbers (zero or more)

pow() 공개 메소드

Calculate the power of x by y
public pow ( float $x, float $y ) : float
$x float The base
$y float The exponent
리턴 float The base to the exponent power (x^y)

random() 공개 메소드

That means a result will always be less than 1 and greater or equal to 0, the same way Math.random() works in JavaScript. See Math.randomInt(min, max) for a function that returns random integer numbers from a given interval.
public random ( ) : float
리턴 float A random floating point number between 0 (inclusive) and 1 (exclusive), that is from [0, 1)

randomInt() 공개 메소드

That means a result will always be greater than or equal to min and less than or equal to max.
public randomInt ( integer $min, integer $max ) : integer
$min integer The lower bound for the random number (inclusive)
$max integer The upper bound for the random number (inclusive)
리턴 integer A random number between min and max (inclusive), that is from [min, max]

round() 공개 메소드

The precision defines the number of digits after the decimal point. Negative values are also supported (-1 rounds to full 10ths).
public round ( float $subject, integer $precision ) : float
$subject float The value to round
$precision integer The precision (digits after decimal point) to use, defaults to 0
리턴 float The rounded value

sign() 공개 메소드

Get the sign of the given number, indicating whether the number is positive, negative or zero
public sign ( integer | float $x ) : integer
$x integer | float The value
리턴 integer -1, 0, 1 depending on the sign or NAN if the given value was not numeric

sin() 공개 메소드

public sin ( float $x ) : float
$x float A number given in radians
리턴 float The sine of the given value

sinh() 공개 메소드

public sinh ( float $x ) : float
$x float A number
리턴 float The hyperbolic sine of the given value

sqrt() 공개 메소드

public sqrt ( float $x ) : float
$x float A number
리턴 float The square root of the given number

tan() 공개 메소드

public tan ( float $x ) : float
$x float A number given in radians
리턴 float The tangent of the given value

tanh() 공개 메소드

public tanh ( float $x ) : float
$x float A number
리턴 float The hyperbolic tangent of the given value

trunc() 공개 메소드

This function doesn't round the given number but merely calls ceil(x) or floor(x) depending on the sign of the number.
public trunc ( float $x ) : integer
$x float A number
리턴 integer The integral part of the given number