When I use this statement:
hserout [dec (12 * 10000),$0D, $0A] the result is 54464.
Why is the math not working?
When I use this statement:
hserout [dec (12 * 10000),$0D, $0A] the result is 54464.
Why is the math not working?
The math is working great - you overflowed (went beyond 16 bits)
12*10000 = 120000 = $1D4C0 (hex)
keeping the lower 16 bits = $D4C0 = 54464
clear as mud?
Last edited by paul borgmeier; - 14th June 2008 at 18:46.
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Where are you sending the data? If sending to a PC, send the 12 and send the 10000. Let the program on the PC handle it.
Or, look at DIV32 in the manual.
Dave
Always wear safety glasses while programming.
or switch to a 18F, and use LONG variable type![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks