Difference between revisions of "Floor"

From Kolmafia
Jump to navigation Jump to search
imported>Heeheehee
m (Technically...)
imported>Heeheehee
m (Missing semicolon.)
Line 23: Line 23:
 
code=
 
code=
 
<syntaxhighlight>
 
<syntaxhighlight>
int purse_rat_ML = floor( familiar_weight($familiar[purse rat] + weight_adjustment())/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>}}|

Revision as of 04:41, 28 March 2010

Function Syntax

int floor(float number )

  • 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!" );

See Also

ceil()