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

floats and intervals, constants, 0.1, 1e400 and Inf



Van Snyder wrote:
> The proposal from IFIP WG 2.5 to P754 preferred that intervals be
> provided with bounds represented by all types the implementor of
> 754 provided.  Conversion between interval representations was not
> addressed, but should have been.  Rounding the bounds outward seems
> like the only sensible definition, unless one knows for sure that
> one or the other bound is exact.  Providing conversions with flags
> that indicate that one or the other bound is exact seems like too
> much complication, at least for a first edition standard.

If converting to a wider type, no rounding occurs.  If converting
to a narrower type, it doesn't help to know whether a bound was
exact or not -- it should still be rounded outwards.  If the bound
was exactly representable in the new type, the rounding will not
change the value, so all is fine.  There is no need for any other
rule here.

> I think P754 can already convert from one precision to another
> with directed rounding.

Yes -- but no more so than for any other arithmetic operation,
unlike roundToIntegral...(), for which explicit rounding control
is mandated.  On IBM's P and Z platforms the instructions that
perform narrowing conversions (or base conversions) do support
explicit rounding independent of the current rounding mode.

Michel.
Sent: 2008-11-10 22:23:54 UTC