Difference between revisions of "Math and Numbers"

From Kolmafia
Jump to navigation Jump to search
imported>Bale
(gameday_to_int)
imported>Bale
(Add monster_eval() & expression_eval() from r8824)
Line 7: Line 7:
 
{{Flink|int|max|int|int}}
 
{{Flink|int|max|int|int}}
 
{{Flink|float|max|float|float|desc=Returns the higher of two numbers.}}
 
{{Flink|float|max|float|float|desc=Returns the higher of two numbers.}}
 +
{{flink|float|expression_eval|string}}
 +
{{flink|float|monster_eval|string}}
 
{{flink|float|modifier_eval|string|desc=Evaluates a mathematical expression.}}
 
{{flink|float|modifier_eval|string|desc=Evaluates a mathematical expression.}}
 
{{Flink|int|random|int|desc=Generates a random integer between 0 and 1 less than the specified number, inclusive.}}
 
{{Flink|int|random|int|desc=Generates a random integer between 0 and 1 less than the specified number, inclusive.}}

Revision as of 09:04, 17 December 2010

int ceil( float )

Returns the next highest value of the specified number as an integer.

int floor( float )

Returns the next lowest value of the specified number as an integer.

int gameday_to_int()

Returns the current KoL date as an integer.

boolean is_integer( string )

Reports whether a string is an integer.

int min( int, int )

float min( float, float )

Returns the lower of two numbers.

int max( int, int )

float max( float, float )

Returns the higher of two numbers.

float expression_eval( string )

float monster_eval( string )

float modifier_eval( string )

Evaluates a mathematical expression.

int random( int )

Generates a random integer between 0 and 1 less than the specified number, inclusive.

int round( float )

Returns the value of the specified number as rounded to the nearest integer.

float square_root( float )

Returns the square root of the specified value.

int truncate( float )

Returns the decimal-stripped value of the specified number as an integer.