Fishes and Pie
A lab notebook for life
Saturday, May 15, 2010
Integer cast order of operations
Using the Arduino integer types:
byte moo = 166;
int pok = 500;
This doesn't work:
long cat = moo*pok;
This works:
long cat = (long) moo*pok;
But only because the default order of operations makes it:
long cat = ((long) moo) * pok;
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment