I’m trying to calculate the cost of a function izq where I use the function div
inside:
izq n | even (n - 1) = ((n - 1) `div` 2)
| otherwise = (((n - 1) `div` 2) + 1)
So work of izq is 1 + the cost of div
applied to (n – 1). However, I’m unsure about the cost of div
. Does anyone know the typical cost of the div
function in Haskell?