Difference between pages "Boolean modifier" and "Ceil"
(Difference between pages)
Jump to navigation
Jump to search
imported>Bale (I'm a typo disaster some days.) |
imported>StDoodle m |
||
Line 1: | Line 1: | ||
{{ | {{ | ||
− | #vardefine:name| | + | #vardefine:name|ceil}}{{ |
− | #vardefine:return_type| | + | #vardefine:return_type|int}}{{ |
FunctionPage| | FunctionPage| | ||
name={{#var:name}}| | name={{#var:name}}| | ||
+ | function_category=Item Management| | ||
function1={{Function| | function1={{Function| | ||
Line 11: | Line 12: | ||
return_type={{#var:return_type}}| | return_type={{#var:return_type}}| | ||
return_also={{#var:return_also}}| | return_also={{#var:return_also}}| | ||
− | parameter1={{Param| | + | parameter1={{Param|float|i}}| |
}}| | }}| | ||
− | + | function_description=This is the ceiling function, which returns the greatest integer less than or equal to i.| | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | function_description= | ||
− | |||
code1={{CodeSample| | code1={{CodeSample| | ||
− | title= | + | title=Code Sample| |
− | description= | + | description=Returns what type of slimes you can fight in the Slime Tube, based on current ML.| |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
code= | code= | ||
<syntaxhighlight> | <syntaxhighlight> | ||
− | + | 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"; | |
− | print("You | + | else if(ML_frac<=10) slime = "slime4"; |
− | </syntaxhighlight>}} | + | else slime = "slime5"; |
+ | print("You will encounter "+slime+" in the Slime Tube."); | ||
+ | </syntaxhighlight>}}| | ||
− | {{SeeAlso| | + | see_also={{SeeAlso|floor}}| |
}} | }} | ||
− | |||
− |
Revision as of 21:39, 8 March 2010
Function Syntax
This is the ceiling function, which returns the greatest integer less than or equal to i.
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