www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Logarithm function

reply kinghajj <kinghajj_member pathlink.com> writes:
I noticed that there is no logarithm function in std.math that allows for any
base. Seeing how it would be simple to make one, I did:

[code]
import std.math;

real log(real b, real n)
{
return std.math.log(n)/std.math.log(b);
}
[/code]
Apr 22 2006
parent reply Dan <Dan_member pathlink.com> writes:
Did anyone notice the absense of Phi, or unit conversion tables?

: (
Apr 22 2006
parent reply BCS <BCS_member pathlink.com> writes:
In article <e2db7d$1ofd$1 digitaldaemon.com>, Dan says...
Did anyone notice the absense of Phi, or unit conversion tables?

: (
I have a mostly working solution at http://www.webpages.uidaho.edu/~shro8822/unit.d It works, but lacks polish.
Apr 22 2006
parent BCS <BCS_member pathlink.com> writes:
In article <e2ej2l$jf7$1 digitaldaemon.com>, BCS says...
In article <e2db7d$1ofd$1 digitaldaemon.com>, Dan says...
Did anyone notice the absense of Phi, or unit conversion tables?
I have a mostly working solution at http://www.webpages.uidaho.edu/~shro8822/unit.d It works, but lacks polish.
If all you need is the conversion then this works. http://www.webpages.uidaho.edu/~shro8822/unit_t.d
Apr 22 2006