art*_*lla 2 ocaml
我尝试以下列方式初始化int64变量:
let k:int64 = 4000000000;;
但是我收到以下错误消息:
Error: Integer literal exceeds the range of representable integers of type int
如何将k初始化为40亿?谢谢.
pad*_*pad 6
您应该使用L说明符来表示int64文字:
L
int64
let k = 4000000000L;;
或者,由于数字超出了int32的范围,您可以从float以下位置进行转换:
float
let k = Int64.of_float 4000000000.;;
归档时间:
13 年,2 月 前
查看次数:
499 次
最近记录: