IEEE 754-1985 - Rounding Floating-point Numbers

Rounding Floating-point Numbers

The IEEE standard has four different rounding modes; the first is the default; the others are called directed roundings.

  • Round to Nearest – rounds to the nearest value; if the number falls midway it is rounded to the nearest value with an even (zero) least significant bit, which occurs 50% of the time (in IEEE 754-2008 this mode is called roundTiesToEven to distinguish it from another round-to-nearest mode)
  • Round toward 0 – directed rounding towards zero
  • Round toward +∞ – directed rounding towards positive infinity
  • Round toward −∞ – directed rounding towards negative infinity.

Read more about this topic:  IEEE 754-1985

Famous quotes containing the words rounding and/or numbers:

    People forget that it is the eye that makes the horizon, and the rounding mind’s eye which makes this or that man a type or representative of humanity with the name of hero or saint.
    Ralph Waldo Emerson (1803–1882)

    Think of the earth as a living organism that is being attacked by billions of bacteria whose numbers double every forty years. Either the host dies, or the virus dies, or both die.
    Gore Vidal (b. 1925)