Re: Division by zero
- From: Nicolas.Capens@xxxxxxxxx
- Date: 27 Dec 2006 04:57:45 -0800
Hi Patricia,
I can't think of any specific algorithm, but there are definitely
situations where an external library supplies a / x but we need a
instead. So we have to multiply by x first. But when x is zero the
external library would return NaN and we can never retrieve a. The
exception being thrown or continuing to work with NaN can result in an
application crash...
If the hardware didn't set the result to NaN for dividing by zero, but
instead kept the value of a and set the Q exponent field to -1, we can
get a back after multiplying by zero. In other words (a / x) * x = a
for any value of x, including zero. This avoids the division by zero
exception and the result is not NaN. Note that a*Q^-1 is NaN, just like
the imaginary i is meaningless in the physical world. But just like i^2
does have a real value, a*Q^-1 becomes a real value again after
multiplying by zero.
Like I've said before, it's arguable that it's the programmer's
responsability to supply a when a is needed, and not a / x. But
mistakes are hard to completely eliminate, and it might be more
efficient to work with a / x most of the time. Testing and correcting
for x = 0 in software is possible, but slow.
Kind regards,
Nicolas
Patricia Shanahan wrote:
Nicolas.Capens@xxxxxxxxx wrote:
Hi all,...
I have a theory to work with division by zero, and it might have some
use in computer science.
I got inspired by Dr. Anderson's 'nullity' number:
http://www.bookofparagon.com/News/News_00012.htm. But as far as I know
it doesn't solve any real problem. At the best he proves that by
allowing a nullity number off the real number line, 0^0 = 0 / 0, in
other words NaN = NaN unlike IEEE 754. I don't think that really helps
us. My proposal does solve actual division by zero problems.
One problem is that addition of numbers with different Q exponent can't...
be defined in a useful way. Powers and roots are definable, but then
the Q exponents are no longer integers. For example the square root of
-4 / 0 is 2*i*Q^-0.5. This illustrates that i and Q are orthogonal,
thus defining a three-dimensional space. In this space 0^0 is still
undefined though.
Any thoughts about this?
If I remember correctly, the NaN and Infinity treatment in IEEE754 was
inspired not just by theory, but by real algorithms that had simpler,
more efficient representations with the extended numbers.
In the same spirit, can you identify some algorithms that would be
simplified by your Q numbers, given the restrictions?
Patricia
.
- References:
- Division by zero
- From: Nicolas . Capens
- Re: Division by zero
- From: Patricia Shanahan
- Division by zero
- Prev by Date: Re: Division by zero
- Next by Date: Re: Division by zero
- Previous by thread: Re: Division by zero
- Next by thread: Re: Division by zero
- Index(es):
Relevant Pages
|