[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
reproducibility of tininess detection for binary formats
Here is another reason to prefer "before rounding" as the reproducible
method: conversions. It boils down to a simple range test that need
not take current rounding mode into account.
I was trying to round up all operations subject to underflow. Addition
and square-root are immune; multiplication and division are the critical
ones. Conversions to a narrower format or a different radix need to be
handled too. Conversions from character string are tricky because it may
be difficult to perform the range check, given the variety of possible
string layouts, so one has to fall back on the retry-with-truncation
method -- or, more likely, pass the rule to be used as a hidden parameter.
The same would probably be applied to other library functions, e.g. the
elementary functions that are subject to underflow.
This discussion of library functions brings up another issue: if we are
to take reproducibility seriously, the effects are wide-ranging, and the
notion almost has to be provided at the "language environment" level,
which must include the mechanisms used to link programs together. This
makes it possible to pass attributes as hidden parameters, or as module
flags that direct linkers to pick matching object files (the technique
often used in mixed 32-bit/64-bit environments).
Michel.
Sent: 2007-10-14 17:02:26 UTC