+ 2
Why are the math.log10(x)and math.log(x,10) results different?
I'm trying to print 20 log 5 value...so, I have to consider base too...Now I got a confusion that how to use? can anyone?
5 Respostas
0
#@ GIRISH TULABANDU
here is a EXPLAINATION CODE..
READ ALL COMMENTS TO GET THE WHOLE IDEA.
MATCH all input codes with output.
https://code.sololearn.com/cNpymcJAJ2GY/?ref=app
+ 5
Most likely they are a bit different implementations resulting in floating-point precision problems.
math.log10(1000) = 3.0
math.log(1000, 10)= 2.99999999996
Both are *equal*, just not floating-point equal :)
+ 4
math.log(20, 5)
+ 1
can you tell me How to print 20log5?
20*math.log10(5)? Is this correct?
- 1
there is 4 log modules...
1. log(value , base)
2. log10(value)
3. log2(value)
4. log1p(value)
1 is general...default base is 'e'
2 is fixed base 10
3 is fixed base 2
4 is fixed bade 'e' but doing logarith of (1+value)-----p denotes plus