算术运算返回负值

时间:2019-11-08 10:49:46

标签: sh integer-arithmetic

我在两个较大的值之间进行了以下运算:

#!/bin/sh
a=$((0x1000000*0x0001d2))
echo $a
# result: -771751936 
# wrong may the root cause is the size of variable

有解决方案吗? 注意:我使用的外壳非常有限(sh)。

0 个答案:

没有答案