Question: This function takes a pair of integers m and n , and should return True iff one integer is a cube of the other integer.
This function takes a pair of integers m and n and should return True iff one integer is a cube of
the other integer. That is
cubem n
should return True if and only if
n m or
m n
Fill in the definition of cube by replacing the word undefined with appropriate Haskell code.
You are allowed to delete the if you need to for example, if you want to define cube using
guards.
Hint: Haskell has an exponentiation operator, but it uses floatingpoint arithmetic so I
wouldnt trust it here. The multiplication operator works on integers as well as floatingpoint
numbers
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
