overflow error

1. Junior Member
Join Date
Dec 1969
Posts
5

## overflow error

I am creating an online report and occassionally 0/0 will need to be computed but i&#039;m running into the overflow error, I need the result to be 0 so on error resume next cannot be used. How can i allow this computation without the overflow error?

2. Senior Member
Join Date
Dec 1969
Posts
1,274

Just put some error checking in to see if the numerator and the denominator are both 0 and if so, return 0. Not that hard.

3. Senior Member
Join Date
Dec 1969
Posts
96,118

## 0 / 0 <> 0

Mathematically, zero divided by zero is undefined. There isn&#039;t any answer. <BR><BR>So the computer is doing the right thing, mathematically.<BR><BR>And why CAN&#039;T you use On Error Resume Next?<BR><BR>&#060;%<BR>quotient = 0<BR>On Error Resume Next<BR>quotient = divident / divisor<BR>On Error GoTo 0<BR>%&#062;<BR><BR>Try it.<BR><BR>

4. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## Why not use a simple..

.. IF:<BR><BR>quotient = 0<BR>If divisor &#060;&#062; 0 Then<BR> quotient = divident / divisor<BR>End If<BR><BR>Save your self from intentionally causing an error.

5. Senior Member
Join Date
Dec 1969
Posts
96,118

## Yes, yes...

...that&#039;s the *better* way, I agree. Lower overhead than ON ERROR, by a bunch.<BR><BR>I was only disputing his assertion that he *could not* use ON ERROR RESUME NEXT.<BR><BR>Ehhh...we should have just told him to go to Q&A and said nothing else. Oh, well.<BR><BR>

6. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## Oh, I didn't actually..

.. read the original post - just yours.<BR><BR>I&#039;ve been questioning you a lot today. :)

7. Senior Member
Join Date
Dec 1969
Posts
96,118

## I was gonna hassle you...

...over the misspelling of "dividen[hl="yellow"]t[/hl]"...until I discovered what idiot misspelled it in the first place.<BR><BR>

8. God
Senior Member
Join Date
Dec 1969
Posts
18,177

## Ha. Well, in all fairness..

... I didn&#039;t know it was misspelled in the first place.<BR><BR>I was just copying what the "idiot" originally posted.

#### Posting Permissions

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