E
ES
Hi,
This expression is giving me some problem: floor(log(k)/log(b)). It
works for many values of k and b (of type double) that I type in, but
when k=8 and b=2, I get floor(log(8)/log(2)) = 2. We know from the
properties of logarithm that this expression should give us a value 3.
I checked log(8)/log(2) = 3. But when I tested it in a simple if
statement if(log(8)/log(2) < 3), it gives me a true statement.
Should I skip this expression altogether and write another function
that behaves like it?
Any help will be appreciated!
--- ES
This expression is giving me some problem: floor(log(k)/log(b)). It
works for many values of k and b (of type double) that I type in, but
when k=8 and b=2, I get floor(log(8)/log(2)) = 2. We know from the
properties of logarithm that this expression should give us a value 3.
I checked log(8)/log(2) = 3. But when I tested it in a simple if
statement if(log(8)/log(2) < 3), it gives me a true statement.
Should I skip this expression altogether and write another function
that behaves like it?
Any help will be appreciated!
--- ES