Re: indeterminate 0/0
- From: Dave Peterson <petersod@xxxxxxxxxxxxxxxx>
- Date: Sun, 30 Jul 2006 20:08:03 -0500
And that indeterminate makes sense, too.
numerator/demoninator = Quotient
which means that
numerator = Quotient * denominator
If the denominator is 0 and the numerator is non-zero, there are no non-zero
numerators that could make:
numerator = quotient * 0
correct.
If both the denominator and numerator = 0, then there are way too many correct
answers that make this:
0 = quotient * 0
(0 * any number = 0, so all numbers are correct)
Dana DeLouis wrote:
"divide by zero" error. I need a way to override this error but need
0/0 to equal 1
Hi. Just for discussion, 0/0 is an "Overflow" error.
Sub Demo()
Dim Ans
On Error Resume Next
'// 6 Overflow
Ans = 0 / 0
Debug.Print Err.Number; Err.Description
'// 11 Division by zero
Ans = 2 / 0
Debug.Print Err.Number; Err.Description
'// Maybe...
If Err.Number = 6 Then Ans = 1
Err.Clear
On Error GoTo 0
End Sub
(But you are correct, certain math programs treat 0/0 as Indeterminate vs
Excel's Overflow)
--
HTH. :>)
Dana DeLouis
Windows XP, Office 2003
"integreat" <integreat.2bs16u_1154293808.7403@xxxxxxxxxxxxxxxxxxxxx> wrote
in message news:integreat.2bs16u_1154293808.7403@xxxxxxxxxxxxxxxxxxxxxxxx
Is there a way to force VBA to do a division by zero without giving the
"divide by zero" error. I need a way to overrride this error but need
0/0 to equal 1
--
integreat
------------------------------------------------------------------------
integreat's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=34282
View this thread: http://www.excelforum.com/showthread.php?threadid=566460
--
Dave Peterson
.
- Follow-Ups:
- Re: indeterminate 0/0
- From: Dana DeLouis
- Re: indeterminate 0/0
- References:
- indeterminate 0/0
- From: integreat
- Re: indeterminate 0/0
- From: Dana DeLouis
- indeterminate 0/0
- Prev by Date: Re: Excel won't stop highlighting
- Next by Date: Re: Setting Specific Cells To Not Print
- Previous by thread: Re: indeterminate 0/0
- Next by thread: Re: indeterminate 0/0
- Index(es):
Relevant Pages
|