Complete.Org: Mailing Lists: Archives: discussion: March 2000:
[aclug-L] Re: New C question

[aclug-L] Re: New C question

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: discussion@xxxxxxxxx
Subject: [aclug-L] Re: New C question
From: Brian Chapman <tchapman@xxxxxxxxxxxxx>
Date: Fri, 17 Mar 2000 22:58:55 -0600
Reply-to: discussion@xxxxxxxxx

At 3/17/00 11:40 PM , Larry Bottorff wrote:
> Let's say I need to know what power of 2 a number is. Mathematically,
> that's just log2(number), right? There doesn't seem to be a log2 in C,
> right? How can I fake one?

i belive log2() is part of the math library. try #include <math.h>.
...and don't forget to use '-lm' when linking. :-)

-- This is the discussion@xxxxxxxxx list.  To unsubscribe,

[Prev in Thread] Current Thread [Next in Thread]