Technical Notes Database
TN625D.txt ROUNDING WITH IEEE FLOATING-POINT
Category :Pascal
Platform :All
Product :Turbo Pascal 4.0+
Description:
Q. How does rounding work with IEEE floating-point numbers?
A. The 8087 math coprocessor uses a different method for
rounding numbers than what you may be used to. In order to
achieve a more even distribution of values, the 8087 uses a
method sometimes called "Banker's Rounding." This method
dictates that a number will always be rounded to the nearest
EVEN number. Note that this is quite different than always
rounding UP. Here are a couple of examples:
Round(0.5) = 0
Round(1.5) = 2
Reference:
7/16/98 4:35:34 PM
Last Modified: 01-SEP-99