Overflow with integer division

Results 1 to 3 of 3

Thread: Overflow with integer division

  1. #1
    Eric L Guest

    Default Overflow with integer division

    Hi there. I&#039;m trying to do some simple integer division (ie: intOne/intTwo), and I&#039;m getting an Overflow error.<BR>Even using CInt(intOne)/CInt(intTwo) gives the error.<BR>Any thoughts?

  2. #2
    Join Date
    Dec 1969

    Default RE: Overflow with integer division

    It has to do with cint, try Clng instead of Cint

  3. #3
    Join Date
    Dec 1969

    Default Also...

    If you divide by zero, you will get overflow in ANY kind of division.<BR><BR>CINT is only good for numbers from -32768 to +32767. Outside that range, you need CLNG. But if you used neither CINT nor CLNG, then the only way you should overflow would be if your divisor was too small (i.e., either zero or really close to it).<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts