Menu

Math division ,multiplication and subtraction.

jeff
2021-07-17
2021-07-17
  • jeff

    jeff - 2021-07-17

    Having touble here getting my program to process
    degrees=180-(count*4.5/1000)
    count max value about 40000
    The code does compile but practically it does not work.
    Can you please advise me ?
    Many thanks

     
  • Anobium

    Anobium - 2021-07-17

    Integer only.

    180-(count*45/100)... is the same

     
    • Anobium

      Anobium - 2021-07-17

      OOPPPS

      =180-(count*45/10/1000)

       
      • Anobium

        Anobium - 2021-07-17

        And, as the calc of 'calc*45' is very big, you need to cast the calc as follows.

        DIM ccount as Word
        DIM result as Word

        ccount = 20000
        result=180-( ( [LONG]ccount*45) /10/1000) 'you can simplify

         

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.