List Info

Thread: Re: how to round a floating-point value to an integer value




Re: how to round a floating-point value to an integer value
country flaguser name
Europe
2007-03-19 08:39:49

From wagnerc:
>That's all good for rounding intermediate numbers in a calculation...

I have a recollection from a computer math class many years ago that you should never, ever, round intermediate numbers in a calculation. The "rounding" itself then becomes part of the next step, then the next, and so on. While that may not be an issue with simple addition/subtraction, multiplication (or worse, exponentiation), could turn a little rounding into a huge error at the end.

Deane Rothenmaier
Programmer/Analyst
Walgreens Corp.
847-914-5150

"I am but mad north-north-west. When the wind is southerly I know a hawk from a hand-saw" -- Hamlet (Act II, scene ii)
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )