We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › newb - int() vs floor()
Page Index Toggle Pages: 1
newb - int() vs floor() (Read 357 times)
newb - int() vs floor()
Aug 7th, 2008, 5:02pm
 
hi, i'm just trying to figure out the difference between int() and floor()

thanks,
Emmanuel
Re: newb - int() vs floor()
Reply #1 - Aug 8th, 2008, 4:21pm
 
They do essentially the same thing. We have floor() along with ceil() for symmetry, and because some people know that syntax.

In some languages, the difference is that floor(float) returns a float, but in Processing it returns an int, however we keep it in the API as a consistency/familiarity thing.
Page Index Toggle Pages: 1