in reply to Add numbers in log domain [solved]
You'll likely have to clarify your question. As I read it, you're probably wanting to compute the logarithm of a sum using a base other than e. But since the documentation for the log function (which you can read via perldoc -f log) covers this, I'm hard pressed to imagine that's what you actually want. But if you did want that, then:
my ($x, $y, $base) = (23.5, 54.3, 2.0); my $result = log($x + $y) / log($base); print "result: $result\n";
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Add numbers in log domain
by BrowserUk (Patriarch) on Jun 04, 2012 at 11:32 UTC | |
by pRaNaV (Novice) on Jun 05, 2012 at 05:59 UTC |