|
Re: Nasty Compiler Bug
I've noticed in general that the C18 compiler handles casting in interesting and often unexpected ways. If you explicitly cast one of those numbers as a long, it should work correctly. However, your point that you should work out as much math as you can before putting it into the code is absolutely correct, in that you'll always get the right answer, and it takes fewer processor cycles.
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed
Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star
_
|