Ceil: Difference between revisions
Jump to navigation
Jump to search
imported>Heeheehee Created page with '{{#vardefine:name|ceil}} {{#vardefine:return_type|int}} {{FunctionPage| name={{#var:name}}| function_category=Item Management| function1={{Function| name={{#var:name}}| aggrega…' |
imported>Bale mNo edit summary |
||
(5 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{#vardefine:name|ceil}} | {{ | ||
{{#vardefine:return_type|int}} | #vardefine:name|ceil}}{{ | ||
#vardefine:return_type|int}}{{ | |||
FunctionPage| | |||
name={{#var:name}}| | name={{#var:name}}| | ||
function1={{Function| | function1={{Function| | ||
Line 11: | Line 11: | ||
return_type={{#var:return_type}}| | return_type={{#var:return_type}}| | ||
return_also={{#var:return_also}}| | return_also={{#var:return_also}}| | ||
parameter1={{Param|float| | parameter1={{Param|float|number}}| | ||
p1desc={{Pspan|number}} is a number to find the ceiling of| | |||
}}| | }}| | ||
function_description=This is the ceiling function, which returns the | function_description=This is the ceiling function, which returns the smallest integer greater than or equal to the supplied {{pspan|number}}.| | ||
code1={{CodeSample| | code1={{CodeSample| | ||
Line 34: | Line 34: | ||
see_also={{SeeAlso|floor}}| | see_also={{SeeAlso|floor}}| | ||
}} | }} | ||
[[Category:Math and Numbers]] |
Latest revision as of 05:04, 22 May 2010
Function Syntax
- number is a number to find the ceiling of
This is the ceiling function, which returns the smallest integer greater 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.");