On 2019/03/29 19:04, Rian De Rous wrote:
I have this code on a PIC18f27k42 and the output of this is 16 instead
of 1000?
5000*200 = 1 000 000, and that fits perfectly in a dword (four bytes).
|
varword a=200
varword b=5000
vardword c=(a*b)/1000
print_dword_dec(lcd,c)
|
I don't know if it's related to the compiler or to the jallib
print_dword_dec() function. But the answer should be 1000 not 16.
See compiler documentation (jalv2.pdf): section 3.2 Casting
--
*Rob H*amerling, Vianen, NL
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/jallib.
For more options, visit https://groups.google.com/d/optout.