Hi Rob, The result on my lcd is the @-symbol now. That's also not equal to 1000... Rian
Op vrijdag 29 maart 2019 19:14:42 UTC+1 schreef Rob Jansen: > > Hi Rian, > > Short check. > > Can you try: var dword c = dword(a * b) / 1000. You might have a casting > problem. > > Kind regards, > > Rob > > ------------------------------ > *Van:* [email protected] <javascript:> <[email protected] > <javascript:>> namens Rob CJ <[email protected] <javascript:>> > *Verzonden:* vrijdag 29 maart 2019 19:11 > *Aan:* [email protected] <javascript:> > *Onderwerp:* Re: [jallib] 5000*200/1000=16? > > Hi Rian, > > Thanks for the info. I will have a look at it maybe this weekend. Did you > use the latest version of Jallib? > > Which compiler version are you running? > > Thanks > > Kind regards, > > Rob > > ------------------------------ > *Van:* [email protected] <javascript:> <[email protected] > <javascript:>> namens Rian De Rous <[email protected] <javascript:>> > *Verzonden:* vrijdag 29 maart 2019 19:04 > *Aan:* jallib > *Onderwerp:* [jallib] 5000*200/1000=16? > > > 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). > > var word a= 200 > var word b= 5000 > var dword 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. > > -- > 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] <javascript:>. > To post to this group, send email to [email protected] <javascript:> > . > Visit this group at https://groups.google.com/group/jallib. > For more options, visit https://groups.google.com/d/optout. > > -- > 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] <javascript:>. > To post to this group, send email to [email protected] <javascript:> > . > Visit this group at https://groups.google.com/group/jallib. > For more options, visit https://groups.google.com/d/optout. > -- 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.
