Port-vax archive

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

Re: Building current...



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?

You'd be making mathematicians and programmers alike cringe, but in the grand scheme of things there really should be two uses for floating point - one is where the results really do matter, in which case the code is poor if it simply assumes a platform has infinities and NaNs, and the other where it doesn't matter (like the KB/sec reported when doing an scp -r which is never calculated correctly when the file starts nor when it is completely finished).

I think that for every program where the results do matter (as far as the user and the function of the program are concerned), there are ten programs that are just bad at handling edge cases or are using floating point in a lazy way and the results don't affect the running of the actual program, so I'd be inclined to at least say to give it a go.

John


Home | Main Index | Thread Index | Old Index