How can I solve a^i=b in Objective C?

  • Context: Undergrad 
  • Thread starter Thread starter rhenretta
  • Start date Start date
  • Tags Tags
    Algebra
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
rhenretta
Messages
65
Reaction score
0
My math skills are failing me, and I was hoping one of you could help me with this real quick..

I need to solve for i:
[itex]a^{i}=b[/itex]

a in this case is based on the interval in the musical scale, so
[itex]a = 2^{\frac{1}{12}}[/itex]

I have to solve this in objective c, and apparently it doesn't let me solve logarithms except for bases 2, 10, and e
 
Mathematics news on Phys.org
rhenretta said:
My math skills are failing me, and I was hoping one of you could help me with this real quick..

I need to solve for i:
[itex]a^{i}=b[/itex]

a in this case is based on the interval in the musical scale, so
[itex]a = 2^{\frac{1}{12}}[/itex]

I have to solve this in objective c, and apparently it doesn't let me solve logarithms except for bases 2, 10, and e

Hey rhenretta.

This kind of problems what is called logarithms. Basically logs and exponentials are inverses in that log(e^x) = x and e(log(x)) = x for valid x's. So we have:

[itex]log_a(a^{i}) = log_a(b)[/itex] gives us
[itex]i = log_a(b) = \frac{ln(b)}{ln(a)}[/itex]

where ln(x) is the natural logarithm function.