Computer Science Canada How to get a logarithm of a number? |
Author: | genius12 [ Sun Nov 25, 2012 7:00 pm ] |
Post subject: | How to get a logarithm of a number? |
What is it you are trying to achieve? I am trying to get turing to find the logarithm of a number. I thought that there would probably be a function for logarithms in Turing but there isn't, or atleast I didn't find one. What is the problem you are having? I can't find a function or a way to get the logarithm of a number. Describe what you have tried to solve this problem I have tried finding a function of method to find the logarithm of a number but was unsuccessful. Please specify what version of Turing you are using 4.1.1 |
Author: | Zren [ Sun Nov 25, 2012 8:04 pm ] | ||
Post subject: | Re: How to get a logarithm of a number? | ||
Oh wow, Turing doesn't actually have log10, log(x, base) or any of that jazz. Well, Turing doesn't have a very full arsenal in this reguard, nor will it ever be expanding. It does have the key function Math.ln(x) which will get you the natural logarithm. Due to some math I can't quite remember, log(x, base) = ln(x) / ln(base). With that we can create our own functions.
|
Author: | genius12 [ Sun Nov 25, 2012 8:42 pm ] |
Post subject: | Re: How to get a logarithm of a number? |
Yup. Well didn't realise that Turing had a natural logarithm function. Thank you for pointing that out. |