Re: IEEE-FP 0.5.2 - Exception handling



Andrew Haley wrote:
Ed <nospam@xxxxxxxxxxx> wrote:
...
The problem is much greater with IEEE. IEEE has nans/infs - which
can pop up anywhere. These aren't numbers and consequently they'll
never converge and get stuck in a loop.

Maybe, maybe not. I'm not convinced that converting overflow to Inf
makes an incorrect program more likely to get stuck in a loop, and
IEEE has the overwhelming advantage that it's reasonably easy to
detect such an overflow. But this is arguing about the qualities of
IEEE arithmetic iteself, which is off-topic for this discussion.

It's a fact of life that not everyone can be convinced.

However you will be writing more "incorrect" programs under IEEE.
That's because one is expected to take into account nan/infs and the
effects of math functions, divide-by-zero, and overflow producing
nans/infs. One would need to be an oracle.

It's not unlike writing portable ANS Forth code. No doubt it can
be done - but has anyone ever got it right the first time around :)

IEEE specifies how numeric input conversion should be done, but
it places no requirements on the language with respect to
floating-point literals.
...

They stipulate how an IEEE *application* might handle numeric input.

This makes no sense. Numeric input conversion is done by the system
itself, not by an application.

I'm sorry that you see no difference between the options available to
an application, and how a compiler behaves.

IEEE says nothing about compilation. One assumes that even IEEE
would balk at the notion that it could be useful for a compiler to
accept "1E9000" and compile an INF.

That seems reasonable enough

To what end? What does entering "1E9000" and compiling
INF or max-float possibly give you - apart from a headache ?

, and is compliant with Standard Forth.

If you mean that Standard Forth permits one to ignore numeric
conversion errors - as one of a range of options - then yes, it is
"compliant". Anyone is free to pick the worst option.



.



Relevant Pages

  • Re: IEEE-FP 0.5.2 - Exception handling
    ... never converge and get stuck in a loop. ... Numeric input conversion is done by the ... and how a compiler behaves. ...
    (comp.lang.forth)
  • Re: How to develop a random number generation device
    ... stepped through to see if it ever gets stuck or goes into a loop. ... if X = X/2; ... running it through a compiler, or static checker, no matter how clever ...
    (sci.electronics.design)
  • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
    ... >> both less efficient and less safe than the Fortran and Basic standard. ... >> The C for loop is actually trying to do what a do loop does. ... sloppy thinking that results from confusing a programming language ... > I do not believe that you are capable of writing a conforming C compiler. ...
    (comp.programming)
  • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
    ... it's a for loop in the C sense. ... > sloppy thinking that results from confusing a programming language ... >> I do not believe that you are capable of writing a conforming C compiler. ... Does Microsoft's C compiler perform this optimisation? ...
    (comp.programming)
  • Re: Histogram of character frequencies
    ... generated object code may simply be a loop in which elements are ... believe any C compiler anywhere would reject it. ... On the first iteration of the loop you test the end of file indicator ...
    (comp.lang.c)

Loading