Re: Floating point in kernel

From: Jeff Garzik (jgarzik@mandrakesoft.com)
Date: Wed May 03 2000 - 18:43:30 EST


"B. James Phillippe" wrote:
>
> Hello,
>
> I know this is not legal. However, I'm reviewing some kernel module code
> which basically does:
>
> unsigned long foo = some_other_ulong * 1.234;

oof :) Reminds me of some fbdev code I saw a while back IIRC

When you really want fractional numbers not literally floating point,
you can always multiple both numbers to make them decimal, perform the
math op, and then divide back down again.

        Jeff

-- 
Jeff Garzik              | Nothing cures insomnia like the
Building 1024            | realization that it's time to get up.
MandrakeSoft, Inc.       |        -- random fortune

- 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.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:13 EST