Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Decimal Exponent

Status
Not open for further replies.

jerome100

Programmer
Dec 6, 2001
2
0
0
CA
I need to know how I should go about calculating a decimal exponent. Any help would be appreciated.
For example 3.5 ^ 7.1
 
You'll be using the math coprocessor (which, in this day and age, is no longer a coprocessor).

Load the numbers into the math coprocessor, and perform the operation.

Unfortunately, the math coprocessor does NOT support an X^Y operation. So what do you do? Well, we CAN use logarithms and their weird properties. Now:

2 log x

happens to be equal to

log x^2


and

y log2 (x)

happens tp be equal to

log2 (x^y)

and as it happens, the processor supports both log base 2 and anti-log base 2 operations.


Implementation is up to you, for the simple reason that while I know how it's done, I've never actually implemented it. Experiment. Back up your hard disk. Good luck.
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top