Ceil: Difference between revisions
Jump to navigation
Jump to search
imported>StDoodle mNo edit summary |
imported>StDoodle mNo edit summary |
||
Line 5: | Line 5: | ||
FunctionPage| | FunctionPage| | ||
name={{#var:name}}| | name={{#var:name}}| | ||
function_category= | function_category=Miscellaneous| | ||
function1={{Function| | function1={{Function| |
Revision as of 21:41, 8 March 2010
Function Syntax
- number is a number to find the ceiling of
This is the ceiling function, which returns the greatest integer less than or equal to the supplied number.
Code Sample
Returns what type of slimes you can fight in the Slime Tube, based on current ML.
float ML_frac = max(0,ceil(monster_level_adjustment()/100));
string slime="";
if(ML_frac<=1) slime = "slime1";
else if(ML_frac<=3) slime = "slime2";
else if(ML_frac<=6) slime = "slime3";
else if(ML_frac<=10) slime = "slime4";
else slime = "slime5";
print("You will encounter "+slime+" in the Slime Tube.");
See Also