Functions

List of the currently supported functions. If it´s not enough ask for other in comments.

New added functions:

    • ceil() — Round fractions up a=ceil(55555.55)= a=ceil(55555.55)=55556
    • Ceil(number,XY) - Round fractions up to multiple number XY Ceil(158.25,20) = 160 a=Ceil(158.25,20) =160
    • floor() — Round fractions down a=floor(10.9999)= a=floor(10.9999)=10
    • Floor(number,XY) - Round fractions up down multiple number XY Floor(158.25,20) = 140 a=Floor(158.25,20) =140
    • round() — Rounds a float a=round(5.5)= a=round(5.5)=6
    • Round(number,XY) - Round fractions to multiple number XY Round(158.25,20) = 160, Round(148.25,20) = 140 a=Round(158.25,20) =160
    • rand(x,y) — Generate a random integer between x, y a=rand(25,50)= a=rand(25,50)=27
    • Rand(size) - random number, size is lenght of number. Example: Rand(4)=5846, Rand(10)=5 879 456 216. a=Rand(5)=16731
    • Exponent - 2^9 a=2^9=512
    • Root - use root{9}{512} a=root{9}{512}=
    • sqrt — Square root a=sqrt{16}= a=sqrt{16}=4
    • Absolute value - a=abs(-5.8)= a=abs(-5.8)=5.8

Basic php functions:

Trigonometric functions:

Cosine, Sine, Tangent, Cotangent:
  • cos — Cosine a=cos(pi)= a=cos(pi)=-1
  • sin — Sine a=sin(pi)= a=sin(pi)=0
  • tan — Tangent a=tan(pi)= a=tan(pi)=-0
  • cot - Cotangent a=cot(0.1)= a=cot(0.1)=9.967

Acr cosine, Arc sine, Arc tangent:

  • acos — Arc cosine a=acos(0)= a=acos(0)=1.571
  • asin — Arc sine a=asin(1)= a=asin(1)=1.571
  • atan — Arc tangent a=atan(500)= a=atan(500)=1.569
Hyperbolic cosine, Hyperbolic sine, Hyperbolic tangent: 
  • cosh — Hyperbolic cosine a=cosh(3.14)= a=cosh(3.14)=11.574
  • sinh — Hyperbolic sine a=sinh(3.14)= a=sinh(3.14)=11.53
  • tanh — Hyperbolic tangent a=tanh(3.14)= a=tanh(3.14)=0.996

Inverse hyperbolic cosine, Inverse hyperbolic sine, Inverse hyperbolic tangent:

  • acosh — Inverse hyperbolic cosine a=acosh(3.14)= a=acosh(3.14)=1.811
  • asinh — Inverse hyperbolic sine a=asinh(3.14)= a=asinh(3.14)=1.862
  • atanh — Inverse hyperbolic tangent a=atanh(3.14)= a=atanh(3.14)=NAN

Other trigonometric function:

  • hypot — Calculate the length of the hypotenuse of a right-angle triangle a=hypot(3,4)= a=hypot(3,4)=5

    Logarithm:

    • log — Base-10 logarithm a=log(10)= a=log(10)=1
    • log(number,base) - a=log(1024,2)= a=log(1024,2)=10
    • ln — Natural logarithm a=ln(e)= a=ln(e)=-INF

    Min & Max:

    • min — Find lowest value a=min(10,15,25)= a=min(10,15,25)=10
    • max — Find highest value a=max(10,15,25)= a=max(10,15,25)=25

    Other

    • fmod — Returns the floating point remainder (modulo) of the division of the arguments a=fmod(18,7)= a=fmod(18,7)=4 (Returns the floating point remainder of dividing the dividend (x) by the divisor (y). The reminder (r) is defined as: x = i * y + r, for some integer i. If y is non-zero, r has the same sign as x and a magnitude less than the magnitude of y.)

    Other php functions you can use:

    • atan2 — Arc tangent of two variables a=atantwo(3.14,1)= a=atantwo(3.14,1)=1.262 (This function calculates the arc tangent of the two variables x and y. It is similar to calculating the arc tangent of y / x, except that the signs of both arguments are used to determine the quadrant of the result.

      The function returns the result in radians, which is between -PI and PI (inclusive).)

    • base_convert — Convert a number between arbitrary bases FOR NOW NOT SUPPORTING
    • bindec — Binary to decimal a=bindec(1011011101)= a=bindec(1011011101)=733
    • decbin — Decimal to binary a=decbin(5486)= a=decbin(5486)=1010101101110
    • dechex — Decimal to hexadecimal a=dechex(5486)= a=dechex(5486)=156
    • decoct — Decimal to octal a=decoct(5486)= a=decoct(5486)=12556
    • degtorad — Converts the number in degrees to the radian equivalent a=degtorad(180)= a=degtorad(180)=3.142
    • expmone — Returns exp(number) - 1, computed in a way that is accurate even  when the value of number is close to zero a=expmone(10)= a=expmone(10)=22025.466
    • getrandmax — Show largest possible random value a=getrandmax()= a=getrandmax()=2147483647
    • hexdec — Hexadecimal to decimal /*NOT SUPPORTING FOR NOW*/
    • isfinite — Finds whether a value is a legal finite number a=isfinite(546548)= a=isfinite(546548)=1
    • isinfinite — Finds whether a value is infinite a=isinfinite(1/3)= a=isinfinite(1/3)=0
    • isnan — Finds whether a value is not a number /*NOT SUPPORTING FOR NOW*/
    • lcgvalue — Combined linear congruential generator a=lcgvalue()= a=lcgvalue()=0.318
    • logonep — Returns log(1 + number), computed in a way that is accurate even when the value of number is close to zero
    • mtgetrandmax — Show largest possible random value
    • mtrand — Generate a better random value
    • mtsrand — Seed the better random number generator
    • octdec — Octal to decimal a=octdec(12556)= a=octdec(12556)=5486
    • pi — Get value of pi a=pi= a=pi=3.142
    • pow — Exponential expression a=pow(2,4)= a=pow(2,4)=16 a=pow(16,1/2)= a=pow(16,1/2)=4
    • radtodeg — Converts the radian number to the equivalent number in degrees a=radtodeg(3.14)= a=radtodeg(3.14)=179.909
    • srand — Seed the random number generator /*NOT SUPPORTED FOR NOW*/




        4 Responses to Functions

        1. Rose Uyeda says:

          Please, are you able to Pm me and inform me couple of far more thinks about this, I am truly fan of one’s weblog… gets solved correctly asap.

        2. Pingback: Menulis Formula/Equation/ Rumus di Wordpress dengan menggunakan Plug In WpMathPublisher | Siti Mutrofin Web

        3. Pingback: WP Math | Best Plugins - wordpress – widgets – plugin 2012

        Leave a Reply

        Your email address will not be published. Required fields are marked *

        You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>