|
Re: Multiplication in EasyC returns insane values!
jgannon beat me to it because I had to go and verify, but yes. -52 is exactly what you get if you try to stuff 460 into a signed char. Your output variable needs to be a signed int to handle that kind of number. the inputs could still be signed chars, I think, as the PIC has an 8 x 8 hardware multiplier that returns a 16-bit answer.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.
Lone Star Regional Troubleshooter
|