Negative powers 8051

8051math-notation

I am attempting to create a calculator using Keil C51 compiling for a DS89c450 target device, but I have run into an obstacle with regards to negative powers. The compiler keeps returning errors when ever I attempt to calculate the inverse of a trigonometric function and a run time error (a null response) occurs when I try negative powers. I believe the documentation states this isn't possible, is it possible with the default math.h or, if not, how would I go about achieving this?

To clarify, this is being completed in C, to assembly.

Thanks for any assistance.

Best Answer

Negative powers are equal to the inverse of the original to the power of the absolute original value. That is to say:

x^-y = 1/x^y

With regards to inverse trigonometric functions, the inverse of a function is also known as the arc of it. eg; sin^-1 = asin cos^-1 = acos tan^-1 = atan

Thanks to Chris Stratton for that helpful reminder!

Related Topic