[R] Exponentiate very large numbers
spencer.graves at structuremonitoring.com
Tue Feb 5 11:47:16 CET 2013
I don't understand the problem: Do you mean that given either
"a" or "b", solve for the other? Otherwise, I don't see an unknown in
the problem statement.
Further, do you mean that "exp( ln(a) ) - exp( ln(0.1) + ln(b) )
Or equivalently, "exp( ln(a) ) = exp( ln(0.1) + ln(b) )"?
If given either "a" or "b" you want to solve for the other in
this last expression? If yes, note that since exp is monotonic, the
equation above is true if and only if
ln(a) = ln(0.1) + ln(b).
Given "b" -- or ln(b) -- you can solve this for "a". ???
hope this helps.
On 2/4/2013 10:58 AM, Rui Barradas wrote:
> Sorry, it should be:
> Divide both terms by exp(log(0.1) + log.b) to give
> tmp1 <- exp(log.a - log(0.1) - log.b) - 1
> result <- tmp1 * exp(log(0.1) + log.b)
> Rui Barradas
> Em 04-02-2013 18:53, Rui Barradas escreveu:
>> Use a simple transfomation. Divide both t
>> log.a <- 1347
>> log.b <- 1351
>> tmp1 <- exp(log.a - log(0.1) - log.b) - 1
>> result <- tmp1 * exp(0.1 + log.b) # -Inf
>> Using base 10, the result would be
>> a number too large for R. See the help page ?.Machine
>> Hope this helps,
>> Rui Barradas
>> Em 04-02-2013 15:11, francesca casalino escreveu:
>>> Dear R experts,
>>> I have the logarithms of 2 values:
>>> log(a) = 1347
>>> log(b) = 1351
>>> And I am trying to solve this expression:
>>> exp( ln(a) ) - exp( ln(0.1) + ln(b) )
>>> But of course every time I try to exponentiate the log(a) or log(b)
>>> values I get Inf. Are there any tricks I can use to get a real result
>>> for exp( ln(a) ) - exp( ln(0.1) + ln(b) ), either in logarithm or
>>> exponential form?
>>> Thank you very much for the help
>>> R-help at r-project.org mailing list
>>> PLEASE do read the posting guide
>>> and provide commented, minimal, self-contained, reproducible code.
Spencer Graves, PE, PhD
President and Chief Technology Officer
Structure Inspection and Monitoring, Inc.
751 Emerson Ct.
San José, CA 95126
More information about the R-help