Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Just to make sure we're on the same page, <code>G</code> is the most significant bit of the three, <code>R</code> comes next and <code>S</code> can be thought of as the least significant bit because its value partially represents the even less significant bits that have been truncated in the calculations. These three bits are only used while doing calculations and aren't stored in the floating-point variable before or after the calculations.</p> <p>This is what you should do in order to round the result to the nearest even number using <code>G</code>, <code>R</code> and <code>S</code>:</p> <p><strong>GRS</strong> - Action<br> <strong>0xx</strong> - round down = do nothing (x means any bit value, 0 or 1)<br> <strong>100</strong> - this is a <strong>tie</strong>: round up if the mantissa's bit just before <strong>G</strong> is 1, else round down=do nothing<br> <strong>101</strong> - round up<br> <strong>110</strong> - round up<br> <strong>111</strong> - round up</p> <p>Rounding up is done by adding 1 to the mantissa in the mantissa's least significant bit position just before <code>G</code>. If the mantissa overflows (its 23 least significant bits that you will store become zeroes), you have to add 1 to the exponent. If the exponent overflows, you set the number to +infinity or -infinity depending on the number's sign.</p> <p>In the case of a tie, you add 1 to the mantissa if the mantissa is odd and you add nothing if it's even. That's what makes the result rounded to the nearest even value.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload