Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Motion 56 -- Level 2, Clauses 12.12.1-12.12.7



Michel

On 2013 Dec 12, at 14:45, Michel Hack wrote:
>> Using ib64 as short for the inf-sup binary64 type, etc., suppose a programmer
>> writes an interval operation such as
>>    zz_ib64 = xx_ib32 op yy_ib128       (*)
>> where "op" is one of the operations required to have "tightest" accuracy.
> ...
> ...
> 
> One might worry about (*) being carried out in binary32 and then widened
> on assignment.  THAT result would not be tightest in the wider format,
> but according to such a language, the programmer ASKED for this.
> 
> The requirement that mixed-type (but same-radix) operations be supported
> is not going away.  What I was proposing was that this could be satisfied
> without combinatorial explosion of conceptually explicitly-typed function
> types (the formatOf approach of 754-2008):  it would be sufficient to have
> one homogeneous form per type, and inputs narrower than that type could
> safely be accomodated through input widening, without compromising even
> tightest evaluation.

Avoiding a combinatorial explosion is obviously important. I'm probably showing my ignorance of programming languages here. Suppose 1788 is implemented by a class library. Suppose the library has "one homogeneous form per type" as you say. How does the library writer tell the compiler to widen a statement like (*) in the right way
- in Fortran?
- in C++?
- in some other modern language, e.g. Python?

John Pryce