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

Re: converting to a wider data type



Van et al,

Is it really that complicated?  This goes back to a basic difference
between us in point of view, reflected in both our view of floating
point conversions to intervals and interval-to-wider-interval
conversions.  An interval [a,b] in a narrow type came from somewhere,
but we don't know where.  As an interval, [a,b] may be interpreted
as rigorously containing some exact result.  When we convert to a "wider"
type, the basic principle is that the interval in the wider type
also contain the exact result.  Looking at the underlying
mathematics, that means that, if [a,b] --> [aa,bb], what is
absolutely necessary is that aa <=a and bb <=b, when a, aa, b, and bb
are interpreted mathematically.  I think  IEEE 754-2008 directed rounding
between data types also specifies an "accuracy" of this conversion
in the sense that aa should be the largest number in the target
precision <= a and bb should be the smallest number in the target
precision >=a.  a and b are completely defined mathematical
numbers, and there is no need to imagine any bits that aren't
actually there in a and b themselves.  This statement is on the
"underlying model" level of discussion, but translates in a mechanical
way to bit patterns.

Baker

Van Snyder wrote:
On Mon, 2008-11-10 at 05:13 -0800, Michel Hack wrote:
Van Snyder wrote:
.
.
.
If converting to a wider type, no rounding occurs.

This depends upon whether one adopts the Kuki or Cody view of FP
numbers:  Are the unwritten bits random, or all zero?  If one adopts the
view that unwritten bits are all zero, then no rounding is needed.  If
one adopts the view that unwritten bits are random then downward
"rounding" of negative lower bounds and upward "rounding" of positive
upper bounds are needed.  By "rounding" in this context I mean filling
the new bits of the fraction with ones instead of zeroes.  For positive
lower bounds or negative upper bounds, the correct thing to do is fill
the new bits of the fraction with zeroes.



--

---------------------------------------------------------------
R. Baker Kearfott,    rbk@xxxxxxxxxxxxx   (337) 482-5346 (fax)
(337) 482-5270 (work)                     (337) 993-1827 (home)
URL: http://interval.louisiana.edu/kearfott.html
Department of Mathematics, University of Louisiana at Lafayette
(Room 217 Maxim D. Doucet Hall, 1403 Johnston Street)
Box 4-1010, Lafayette, LA 70504-1010, USA
---------------------------------------------------------------