View Single Post
  #13   Spotlight this post!  
Unread 01-03-2007, 11:25
WesleyC WesleyC is offline
Registered User
FRC #1825
 
Join Date: Jan 2007
Location: Johnson County, KS
Posts: 16
WesleyC is on a distinguished road
Re: Programming tricks (and former trade secrets)

Thanks for the notes!

I'm coming from a PHP background--all math is given equal precedence in PHP; you use parenthesis to emphasize certain points to be performed first--also, all expressions are evaluated before math is performed.

Also, one thing you must be careful of when using this particular phrase is that the input variable must either be an int or typecast to an int before performing math. If "input" is a char, the math will overflow the size of the type, creating... shall we say, "undesirable" results.