View Single Post
  #6   Spotlight this post!  
Unread 13-01-2008, 16:48
Nathan's Avatar
Nathan Nathan is offline
Registered User
FRC #1501 (Team T.H.R.U.S.T.)
Team Role: Alumni
 
Join Date: Sep 2006
Rookie Year: 2007
Location: United States
Posts: 149
Nathan has a spectacular aura aboutNathan has a spectacular aura aboutNathan has a spectacular aura about
Re: Multiplication in EasyC returns insane values!

Thanks for the reply!! I casted my first example like so:

Code:
int temp = 0;
temp = (int)46 * (int)10;
PrintToScreen ( "%d\n" , (int)temp );
The printed value is 460, so it works!

I tried this code however:
Code:
long temp = 0;
temp = (long)466 * (long)100;
PrintToScreen ( "%ld\n" , (long)temp ) ;
And "0b608" prints out. I'm assuming the value is in hex, which is kind of annoying. Did I write the print to screen parameters incorrectly?

Thanks for all your help,
Nathan
__________________
Save money with PriceWombat, a shopping comparison and price tracking tool (that I made!).

Check out my hobby electronics business!

My former robotics team: Huntington County 4-H Robotics