<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On Sep 4, 2020, at 2:40 PM, Neil Nelson via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div></blockquote><blockquote type="cite" class=""><br class=""></blockquote><blockquote type="cite" class=""><div class=""><blockquote type="cite" cite="mid:CAO0d_3C7qc78QqNyRt9ePz_e3pcM0rpfepLtzdDNcob07R+5BA@mail.gmail.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div dir="ltr" class=""><div class="">If fptosi takes 0.9 -> 0, then that is not 'rounding' in any sense I'm aware of (IEEE754 or otherwise). </div><div class="">Rounding (in the IEE754 sense) determines how a number is converted when it is halfway between two</div><div class="">candidate results. (see round(), ceil(), floor()).</div></div></blockquote></div></blockquote><br class=""></div><div>Rounding in the IEEE 754 sense is simply an algorithm to choose one of the two closest values from some set. It does not only concern how halfway cases are handled. There are a number of rounding attributes defined by IEEE 754:</div><div><br class=""></div><div>- round to nearest, ties to even (default rounding)</div><div>- round to nearest, ties away from zero (only for decimal)</div><div>- round to nearest, ties toward zero (used only for augmented addition)</div><div>- round up</div><div>- round down</div><div>- round toward zero</div><div><br class=""></div><div>The last of these is the rounding mode under discussion on this thread. Note that the first three have to specify how halfway cases are handled (“ties to …”), but the latter three do not (because the result is constant across the interval between any two values, so there is not change at “halfway”).</div><div><br class=""></div><div>– Steve</div></body></html>