0
$\begingroup$

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?

$\endgroup$
1
  • 1
    $\begingroup$ Could you provide more context to your question, e.g. the challenge and the language? $\endgroup$
    – Kenny Lau
    Commented Dec 28, 2017 at 13:04

1 Answer 1

0
$\begingroup$

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
$\endgroup$
2
  • $\begingroup$ Thanks..! works perfectly.. $\endgroup$ Commented Dec 28, 2017 at 13:52
  • $\begingroup$ Current format makes difficult to read! $\endgroup$ Commented Dec 28, 2017 at 21:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .