Let N(x) be the value of the decimal numeral with the fewest significant digits
such that x is the double
value nearest the value of the numeral.
Given double
values a and b, how can we compute the double
value nearest N(b)-N(a)?
E.g.:
- If a and b are the
double
values nearest .2 and .3,
- the desired result is the
double
value nearest .1,
- 0.1000000000000000055511151231257827021181583404541015625,
- rather than than the result of directly subtracting a and b,
- 0.09999999999999997779553950749686919152736663818359375.
- the desired result is the