Search code examples
haskellexponentialexponent

Haskell - Is it possible to take 2 ints and find a common exponent?


Lets say i want to find if the relation between the amount of possible triangles with integer angles and quadrilaterals with integer angles can be represented by an exponent. like say T is triangles and Q is quadrilaterals

Q = T^x

Is there a function that I can use to find if i can represent it like that and if possible, what the exponent is?


Solution

  • If q = t^x, then x = logBase t q.