Floor: Difference between revisions
Jump to navigation
Jump to search
imported>StDoodle mNo edit summary |
imported>Bale mNo edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
FunctionPage| | FunctionPage| | ||
name={{#var:name}}| | name={{#var:name}}| | ||
function1={{Function| | function1={{Function| | ||
Line 20: | Line 19: | ||
code1={{CodeSample| | code1={{CodeSample| | ||
title=Code Sample| | title=Code Sample| | ||
description=Prints the amount of "help" you're getting from your purse rat.| | |||
code= | code= | ||
<syntaxhighlight> | <syntaxhighlight> | ||
int purse_rat_ML = floor( familiar_weight($familiar[ purse rat ])/2 ) | 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!" ); | print( "Your squeaky little buddy is currently generating " + purse_rat_ML + " extra ML!" ); | ||
</syntaxhighlight>}}| | </syntaxhighlight>}}| | ||
Line 29: | Line 28: | ||
see_also={{SeeAlso|ceil}}| | 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!" );