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

Re: a question about formatOf operations



On Wed, 05 Mar 2008 10:41:23 +0900, David Hough 754R work <754r@xxxxxxxxxxx> 
wrote:
So in particular, if an implementation supports binary32, binary64,
and binary80 (or any other three binary formats), then it
"provides" a way to compute

 binary64 = binary32 + binary80

with only one rounding error.    The most likely implementation approach,
from a hardware point of view, is to have operations with homogeneous
operands and narrowing results, e.g.
...
However my question is about programming language specification.
How exactly is one going to "provide" the most general forms of
these operations in C or Fortran and other languages likely to support
multiple floating-point types?

You aren't.

Because "provide" might mean defining and implementing a function which
might be passed by reference, it would seem that all of the odd
combinations like

 binary64 = binary32 + binary80

might need to be given specific names and specific implementations

Providing specific functions for all the operator/operandkind/resultkind
combinations is a total nonstarter IMO.

You certainly need some syntax for specifying the output form,
though one could require that
   Real( <level-2-expr> <add-op> <add-operand>, some_ieee_kind )
computes the result "with only one rounding error" (referencing
754R to get the meaning).

That's far better than hordes of specific functions, but still not
exactly wonderful.

and this is getting to be pretty expensive in documentation and
implementation.

"ridiculous" is the word that springs to my mind.

If there is no demand for this kind of thing from the Fortran community,
it is highly unlikely that it will get added to the Fortran standard or
to any significant number of implementations thereof.

IMO 754R needs to restrict itself to things that are widely desired or
which at least don't have widespread opposition.  Imposing onerous
requirements for conformance in areas that don't have widespread
agreement is just counterproductive.

Cheers,
-- 
................Malcolm Cohen (malcolm@xxxxxxxxxxx)


754 | revision | FAQ | references | list archive