HP Forums

Full Version: (12C) Power of Negative Number
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Program to solve for Negative Base with Fractional Power

X^Y can calculate as -X^(Fractional Y)

Procedure:

X [R/S] Y [R/S] answer

Example: -55^(1/5)

55 [CHS] [R/S] display 55

5 [1/x] [R/S] display -2.2288

Example: 2^(-1/2)

2 [R/S] dispaly 2

2 [CHS] [1/x] dispaly -0.5 [R/S] 0.7071

Program:
Code:

01 0
02 X<>Y
03 X<=Y  // Is Base Negative?
04 GTO 09 // Base is Negative goto line 09
05 ENTER  // Base not Negative 
06 R/S  // Stop to enter the power
07 Y^X  // Calculate normally
08 GTO 00  // Done
09 0
10 X<>Y
11 X<=Y  // Convert negative integer to positive integer
12 CHS
13 STO 0  // store positive Base
14 R/S
15 STO 1  // store Power
16 FRAC
17 X=0  // Is the Power in Fraction?
18 GTO 20  // No fraction Power
19 GTO 24  // Yes it is fraction Power
20 RCL 0
21 RCL 1
22 Y^X  // Power integer calculate normally
23 GTO 00
24 RCL 0
25 RCL 1
26 Y^X  // Fractional integer 
27 CHS  // Change Sign
28 GTO 00

Remark: This program doesn’t calculate in the complex numerical form.

Gamo
Reference URL's