Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Building current...



> On Dec 1, 2015, at 8:03 PM, Johnny Billquist <bqt%softjar.se@localhost> wrote:
> 
> On 2015-12-02 01:57, Paul Koning wrote:
>> 
>>> On Dec 1, 2015, at 6:29 PM, Johnny Billquist <bqt%softjar.se@localhost> wrote:
>>> 
>>> After some hiatus, "my" VAX 8650 is back among the living, so I decided to try and build current again.
>>> ...
>>> Now the "analysis". It appears that programs call log10() with an argument of 0, and consider this to be normal.
>>> Unfortunately, this is one of those places where the VAX not doing IEEE FP bites us. The IEEE log10() of 0 will return -inf, and happily chug on. The VAX log10() of 0 will cause an illegal instruction trap.
>>> 
>>> I suspect the other programs crashing might be because of the same reason. The question is - what should we do? I'm tempted to just change the code for log() to return 0, or possible -MAX_whatever and not trap. Opinions?
>> 
>> Why not simply fix the bug?  log(0) is invalid.  It's probably an initialization error, where log() is used for some magic timekeeping math that is only valid the second time around.
> 
> Yes, except I suspect that people are happy just to write the code that way, as IEEE FP actually "can deal with it". log(0) indeed do not give a valid value, and the IEEE version indeed returns an invalid value. But as long as you don't play with it, the processor allows you do continue doing it. They are essentially deferring any effects until you actually try to use the result. Which I then suspect the code do not.

Just because people are happpy to write incorrect code and ignore the fact they have created a bug doesn't mean we should let such bad practice go unchallenged.

Given this discussion, I'm inclined to view the existence of Inf and NaN a design error of IEEE float.  The excuse they have is that they weren't the first ones to do it.  (That distinction might go to Cray, for the CDC 6000, or possibly to even older machines.)

	paul



Home | Main Index | Thread Index | Old Index