I am learning f #. Given this function:
let mult (a:decimal) (b:int) : decimal = a * b
When I try to compile, I get this error: Error 1 Type restriction mismatch. Int is not compatible with decimal
Why does the compiler not accept this?
PS: When I convert the expression, it compiles:
let mult (a:decimal) (b:int) : decimal = a * decimal(b)
source
share