Re: Symbol Substitution Mystery
- From: "Richard B. Gilbert" <rgilbert88@xxxxxxxxxxx>
- Date: Thu, 10 Jul 2008 22:17:14 -0400
VAXman- @SendSpamHere.ORG wrote:
In article <3cSdnaNs9bN1LuvVnZ2dnUVZ_hGdnZ2d@xxxxxxxxxxx>, "Richard B. Gilbert" <rgilbert88@xxxxxxxxxxx> writes:VAXman- @SendSpamHere.ORG wrote:In article <VKqdnXSH5OuUHOvVnZ2dnUVZ_jqdnZ2d@xxxxxxxxxxx>, "Richard B. Gilbert" <rgilbert88@xxxxxxxxxxx> writes:I may be old enough to remember the "Bowmar Brain" but I'm also old enough to have forgotten it, if I ever saw one!Rob Brown wrote:C'mon Richard, your old enough to remember the Bowmar Brain -- add, subtract,On Wed, 9 Jul 2008, AEF wrote:Since you should know better than to attempt division by zero, some sort of arithmetic trap seems appropriate. It's been a few years since I last attempted to divide by zero but I don't think I was EVER allowed to get away with it. Floating point divide by zero should both trap and set the result to "NAN" (not a number) if the hardware supports such a thing.
Yes, that makes sense -- especially if division is performed by repeatedly subtracting .... (If that's not how it's done I'm all ears.)I might have thought that it would use the divide instruction. On VAX the integer DIV instruction does one of two specific things on divide by 0, neither of which is to return 2**31 - 1. On Alpha, there is no integer divide instruction, but floating divide by zero causes a "Division by Zero Arithmetic Trap" and the value in the result register is UNPREDICTABLE.
I would have hoped that division by zero would have been special-cased.Looks to me like returning 2**31 - 1 is special-casing divide by 0.
In a perfect world, what would you like it to do?
multiply and integer divide (e.g. 5/3 = 1). I had one (well, Dad did and I'd
play with it for hours when he wasn't using it) and division by zero returned
a large number (I don't recall the specific value).
Fair 'nuff. Your memory, they say, is the second thing to go. ;)
Okay, Okay, I had a temporary resurgence of mental power and Googled for "Bowmar Brain". It was a "4 banger" pocket calculator manufactured in 1971-1972. It sold for something like $200 US. These days you can get one for $0.50 and three Wheaties box tops.
I got a H-P scientific calculator a few years later; it had Square Root, Log, and Trig functions.
These days I crank up Excel for calculations I can't do on my fingers and toes!
.
- References:
- Re: Symbol Substitution Mystery
- From: Rob Brown
- Re: Symbol Substitution Mystery
- Prev by Date: Re: Symbol Substitution Mystery
- Next by Date: Re: Symbol Substitution Mystery
- Previous by thread: Re: Symbol Substitution Mystery
- Next by thread: Re: Symbol Substitution Mystery
- Index(es):
Relevant Pages
|
Loading