【发布时间】:2019-09-11 12:59:55
【问题描述】:
考虑这个定义:
fun abs(x:int):int = (x*x)/(~x);
应该返回输入的绝对值。但是当函数被调用时,我得到了这个错误:
Error: operator and operand don't agree [tycon mismatch]
operator domain: real * real
operand: int * int
in expression:
x * x / ~ x
我做错了什么?我没有正确使用:int吗?
谢谢
【问题讨论】:
标签: ml