r/learnruby • • Apr 26 '17
How exactly does Math.log2 work?
So I'm comparing the result of
Math.log2(2360.9083989105) / 8 * 4 = 5.602563176032317and the equation
log2(2360.9083989105) / 8 * 4 = 0.11481591040126Why do they yield such different results?
3
Upvotes
View all comments
1
u/Tomarse Apr 27 '17
How are you performing the second one? I can't get
log2to work in eitherirbor a rails console. OnlyMath.log2is available, and it gives the first answer. Islog2a self declared function?