summaryrefslogtreecommitdiff
path: root/shell/ash_test/ash-arith/arith-bignum1.tests
blob: ef8f928bcacbb749ab64657b6835d7751e2259c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
exec 2>&1
# If the number does not fit in 64 bits, bash uses truncated 64-bit value
# (essentially, it does not check for overflow in "n = n * base + digit"
# calculation).
echo 18 digits: $((999999999999999999))
echo 19 digits: $((9999999999999999999))
echo 20 digits: $((99999999999999999999))
echo 18 digits- $((-999999999999999999))
echo 19 digits- $((-9999999999999999999))
echo 20 digits- $((-99999999999999999999))
echo "Hex base#:"
printf '16 digits: %016x\n' $((16#9876543210abcedf))
printf '17 digits: %016x\n' $((16#9876543210abcedfc))
printf '18 digits: %016x\n' $((16#9876543210abcedfcc))
printf '16 digits: %016x\n' $((-16#9876543210abcedf))
printf '17 digits: %016x\n' $((-16#9876543210abcedfc))
printf '18 digits: %016x\n' $((-16#9876543210abcedfcc))