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

formatOf operations (was: C language binding of P1888 operations, especially min and max)



On 2013-10-06 16:03:12 -0400, Michel Hack wrote:
> > So for each "k", it is necessary 2^(k+1) variants.
> > This is a combinatoric explosure.
> > How can I bind this in C ?
> 
> Input arguments can be widened to the widest-supported type.  This avoids
> combinatorial explosion; you only need one function per target type.

I agree. 

> Several functions, including min/max, don't involve rounding, so you can
> generate a wide result and round it once to the target type.

Even when rounding is involved, I recall that in directed rounding,
thus for interval hulls too, one doesn't have the "double rounding"
problem if the target type is included (as a set) in some intermediate
type(s); with the same radix requirement (and inclusion of exponent
range, which is satisfied in practice), this is the case here in the
P1788 context. That's also why I think that these formatOf operations
are useless for P1788.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)