Fast find, between two numbers, in a list

Started by kanen, May 02, 2010, 07:57:13 PM

Previous topic - Next topic

Lutz

#15
... but be aware that this round-half-away-from-zero rounding mode should only be used in a limited type of financial applications, not for financial modeling or for general mathematics type of problems.



In fact for financial accounting floating point numbers shouldn't be used at all but only decimal mode calculations, e.g. using the BCD mode in the i386 family of processors. This is also why Java has a BigDecimal class.



Rounding with above method introduces a systematic bias when adding many rounded numbers in only one, the negative or positive number area.



This bias is not present in newLISP or 'C' and other languages using round-to-nearest type, unbiased rounding as the individual bias evens itself out including when only rounding either positive or negative numbers.



See the Wikipedia article: http://en.wikipedia.org/wiki/Rounding">http://en.wikipedia.org/wiki/Rounding