Floor: Difference between revisions
Jump to navigation
Jump to search
imported>Out of practice Created page, discription of floor() function, example using the Purse Rat ML calculation |
imported>Bale mNo edit summary |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ | |||
#vardefine:name|floor}}{{ | |||
#vardefine:return_type|int}}{{ | |||
FunctionPage| | |||
name={{#var:name}}| | |||
function1={{Function| | |||
print( "Your squeaky little buddy is currently generating "+purse_rat_ML+" ML | name={{#var:name}}| | ||
aggregate={{#var:aggregate}}| | |||
return_type={{#var:return_type}}| | |||
return_also={{#var:return_also}}| | |||
parameter1={{Param|float|number}}| | |||
p1desc={{Pspan|number}} is the number to find the floor of| | |||
}}| | |||
function_description=This is the floor function, which returns the largest integer less than or equal to the supplied {{pspan|number}}.| | |||
code1={{CodeSample| | |||
title=Code Sample| | |||
description=Prints the amount of "help" you're getting from your purse rat.| | |||
code= | |||
<syntaxhighlight> | |||
int purse_rat_ML = floor( familiar_weight($familiar[purse rat] + weight_adjustment())/2 ); | |||
print( "Your squeaky little buddy is currently generating " + purse_rat_ML + " extra ML!" ); | |||
</syntaxhighlight>}}| | |||
see_also={{SeeAlso|ceil}}| | |||
}} | |||
[[Category:Math and Numbers]] |
Latest revision as of 05:04, 22 May 2010
Function Syntax
- number is the number to find the floor of
This is the floor function, which returns the largest integer less than or equal to the supplied number.
Code Sample
Prints the amount of "help" you're getting from your purse rat.
int purse_rat_ML = floor( familiar_weight($familiar[purse rat] + weight_adjustment())/2 );
print( "Your squeaky little buddy is currently generating " + purse_rat_ML + " extra ML!" );