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,
cube(m, n)
should return True if and only if
1. n = m3, or
2. m = n3.
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 floating-point arithmetic so I
wouldnt trust it here. The multiplication operator * works on integers (as well as floating-point
numbers).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!