SigServer:SignatureMath: Difference between revisions

From AniDB
Jump to navigation Jump to search
Line 20: Line 20:


==== floor ====
==== floor ====
  ''number'' floor(''number'' value);
  ''number'' '''floor'''(''number'' value);
Returns the floor of a number.
Returns the floor of a number.


Line 28: Line 28:


==== max ====
==== max ====
  ''number'' max(''number'' value1, ''number'' value2[, ''number'' ...]);
  ''number'' '''max'''(''number'' value1, ''number'' value2[, ''number'' ...]);
Returns the numerically highest value of the given arguments. At least two arguments are required.
Returns the numerically highest value of the given arguments. At least two arguments are required.


Line 37: Line 37:


==== min ====
==== min ====
  ''number'' min(''number'' value1, ''number'' value2[, ''number'' ...]);
  ''number'' '''min'''(''number'' value1, ''number'' value2[, ''number'' ...]);
Returns the numerically lowest value of the given arguments. At least two arguments are required.
Returns the numerically lowest value of the given arguments. At least two arguments are required.


Line 45: Line 45:


==== mod ====
==== mod ====
  ''number'' mod(''number'' dividend, ''number'' divisor);
  ''number'' '''mod'''(''number'' dividend, ''number'' divisor);
Returns the reminder when dividing dividend with divider.
Returns the reminder when dividing dividend with divider.


Line 52: Line 52:


==== pow ====
==== pow ====
  ''number'' pow(''number'' base, ''number'' exp);
  ''number'' '''pow'''(''number'' base, ''number'' exp);
Returns base to the power of exp.
Returns base to the power of exp.


Line 60: Line 60:


==== round ====
==== round ====
  ''number'' round(''number'' value[, ''number'' precision]);
  ''number'' '''round'''(''number'' value[, ''number'' precision]);
Returns base to the power of exp.
Returns base to the power of exp.


Line 69: Line 69:


==== sqrt ====
==== sqrt ====
  ''number'' sqrt(''number'' value);
  ''number'' '''sqrt'''(''number'' value);
Returns the square root of value.
Returns the square root of value.


'''Example'''
'''Example'''
  sqrt(9); // Returns 3
  sqrt(9); // Returns 3

Revision as of 18:12, 2 December 2007

Function Reference

Mathematical

abs

number abs(number value);

Returns the absolute value of a number

Example

abs(1);  // Returns 1
abs(-1); // Returns 1

ceil

number ceil(number value);

Returns the ceiling of a number.

Example

ceil(1.4); // Returns 2
ceil(1.9); // Returns 2

floor

number floor(number value);

Returns the floor of a number.

Example

floor(1.1); // Returns 1
floor(1.9); // Returns 1

max

number max(number value1, number value2[, number ...]);

Returns the numerically highest value of the given arguments. At least two arguments are required.

Example

max(3, 5);           // Returns 5
max(3, 1.2, 5, 5.1); // Returns 5.1


min

number min(number value1, number value2[, number ...]);

Returns the numerically lowest value of the given arguments. At least two arguments are required.

Example

min(3, 5);           // Returns 3
min(3, 1.2, 5, 5.1); // Returns 1.2

mod

number mod(number dividend, number divisor);

Returns the reminder when dividing dividend with divider.

Example

mod(10, 3); // Returns 1

pow

number pow(number base, number exp);

Returns base to the power of exp.

Example

pow(3, 2); // Returns 9
pow(2, 3); // Returns 8

round

number round(number value[, number precision]);

Returns base to the power of exp.

Example

round(2.4);     // Returns 2
round(2.5);     // Returns 3
round(2.55, 1); // Returns 2.6

sqrt

number sqrt(number value);

Returns the square root of value.

Example

sqrt(9); // Returns 3