Raising fractions to powers using only whole numbers

40 Views Asked by At

I need to be able to raise fractions to a power, eg:

$f^2=a$

$1.5^2=2.25$

$f^3=b$

($1.5^3=3.375$)

But the challenge I'm facing is that the coding language I'm using only supports whole numbers for f: 1, 2, 3, 4, 5, 6... (i.e. the left side of the equation)

Is there a way to expand this formula with more variables so that only whole numbers are used?

Any possible workarounds?

1

There are 1 best solutions below

2
On BEST ANSWER

You can raise the integers to a power and divide, eg

f^2 = a   
1.5 = 3/2  
3^2/2^2 = 9/4 = 2.25