test_1 :: Int -> Int
test_1 y = 5 * 10 ^ (ceiling ( logBase 10 y ) ) + 100
Here is the error message:
parse.hs:23:22: error:
• No instance for (RealFrac Int) arising from a use of ‘ceiling’
• In the second argument of ‘(^)’, namely
‘(ceiling (logBase 10 y))’
In the second argument of ‘(*)’, namely
‘10 ^ (ceiling (logBase 10 y))’
In the first argument of ‘(+)’, namely
‘5 * 10 ^ (ceiling (logBase 10 y))’
parse.hs:23:32: error:
• No instance for (Floating Int) arising from a use of ‘logBase’
• In the first argument of ‘ceiling’, namely ‘(logBase 10 y)’
In the second argument of ‘(^)’, namely ‘(ceiling (logBase 10 y))’
In the second argument of ‘(*)’, namely
‘10 ^ (ceiling (logBase 10 y))’
Failed, modules loaded: none.
But if I try this function by simply using a real number:
test = 5 * 10 ^ (ceiling ( logBase 10 1000 ) ) + 100
It works fine.