NCEG meeting

Bob Alverson validgh!uunet!colossus.tera.com!bobaSun.COM
Tue Jan 22 17:53:41 PST 1991


I'm confused about rounding modes.

Is a compiler expected to emit code to convert decimal constants to
binary at run-time?  If not, it may assume the wrong round mode and
give an incorrect result.  I suppose you could convert the decimal
to two numbers and use an add at run-time to do the round.  In general,
when the compiler can't deduce the round mode, constant folding and
common subexpression elimination is thwarted.

Is it worth it to define round modes so that a compiler can deduce
(easily?) the current value at any point in a program?  At least,
define them so that "vanilla" programs that don't mention round modes
allow the compiler to deduce the round mode, maybe?  I can imagine
that some routines would want to inspect the caller's round mode (strtod
and fconvert, e.g.) but that most (user-written) want to use round
to nearest.

Bob



More information about the Numeric-interest mailing list