![]() |
c maths
Hi i want to calculate the following function
T=-(1/l)*ln(1-y)... I must do this without using an ln function...but only using the log... Any good suggestion? Thx :) |
I won't give you the code to calculate it, but I can give you the formulae you want to utilise in writing it:
logfactor number=(logotherfactor number) / (logotherfactor factor) The factor of ln is e, the factor of lb is 2, the factor of lg (sometimes called ld, sometimes called just log) is 10. |
basically, you want to calculate e and just use the log function on it
click here |
What's the meaning of calculating E? Isn't it present in the math library already?
|
[http://www.mathworks.com/access/help.../functi10.html]
To calculate e, do exp(1). |
read what alaious said!!! you can only use log(etc.) function
|
Quote:
|
The typical usage is "log" followed by a subscript radix, space, and the number. Alternatively it can be "l" followed by a single character for the radix (b-binary, n-natural, d-decimal are the most common ones), space, and a number. Or, it can be "lg", which most often represents radix 10. It varies a bit, but those are the most common ones in mathematical representation.
Then programming languages don't look exactly like that, of course, so they use their own, native syntax. |
Quote:
http://en.wikipedia.org/wiki/Binary_logarithm seems to agree. Also, Wikipedia lists ld as synonymous with the binary algorithm. Never seen it before, but eh, doesn't matter. But lg meaning base 10 is disconcerting to me. |
Mathworld seems to have an acceptable explanation:
http://mathworld.wolfram.com/Lg.html From Russia with love, eh liorean? :D |
Actually, I've never seen 'lg' being used for binary logarithms before, but on the other hand I'm not that interested in math to have read that very many different sources. That you default to decimal when you hove no specified radix for 'log' is only natural, however.
As for your information, the books we used in gymnasial math seems to derive mainly from Swedish mathematical journals and sciences encyclopedias that in turn have centuries of history, deriving back to primarily two works: The journal Acta Mathematica (not sure about that spelling) by a number of famous Swedish mathematicians, and the Encyclopedia. I don't know from where the logarithm syntax in specific derives, however. I do wonder about the conventions in international Mathematics, though. English conventions and litterature must have taken a greater prominence today, but I believe that Germany, France and Russia as well as a number of lesser Europeans nations, have had a large influence on the international conventions used in Math than the English speaking countries have. |
| All times are GMT +1. The time now is 05:01 PM. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.