Re: floating-point abuse in 2.1.113

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Tue, 4 Aug 1998 22:01:46 +0200 (MEST)


Mikael Pettersson wrote:
> On Tue, 4 Aug 1998, Geert Uytterhoeven wrote:
>
> > On Tue, 4 Aug 1998, Mikael Pettersson wrote:
> > > - frequency = (frequency / 16.0) * 100; /* massage data a bit */
> > > + frequency = (frequency * 100) / 16; /* massage data a bit */
> >
> > Shouldn't these be rounded, i.e.
> >
> > frequency = (frequency * 100 + 8) / 16;
>
> No, there is no rounding in the original calculation:

Yes, thank you, most of us know C.

Question stands: Shouldn't these be rounded?

Someone might have forgotten the round operation, and as we're looking
at the code right now, lets make sure we get it right....

Roger.

-- 
Actor asks a collegue: "To what do you owe your success in acting?"
Answer: "Honesty. Once you've learned how to fake that, you've got it made."
-------- Custom Linux device drivers for sale! Call for a quote. ----------
Email: R.E.Wolff@BitWizard.nl || Tel: +31-15-2137555 || FAX: +31-15-2138217

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html