Menu

division and remainder

Help
Santiago
2011-02-06
2013-05-30
  • Santiago

    Santiago - 2011-02-06

    Hello all.

    I'm doing something like this:

    division = a/b
    remainder = a%b

    But this call the division routine twice, what is not very efficient.
    Is there any method to have the remainder of a division without doing the division again?

    Thanks.

     
  • Santiago

    Santiago - 2011-02-07

    Thanks gcha44, that works ok, but i had to do:

    dim volt0        as integer
    dim division   as integer
    dim remainder as integer

    division = volt0/100: remainder = SysCalcTempX : remainder_h = SysCalcTempX_h

    if i do this:

    division = volt0/100: remainder = SysCalcTempX

    i have the high byte cleared

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.