mirror of
https://git.busybox.net/busybox
synced 2025-05-10 04:33:59 +02:00
function old new delta parse_with_base - 170 +170 evaluate_string 1477 1309 -168 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/1 up/down: 170/-168) Total: 2 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
17 lines
767 B
Text
Executable file
17 lines
767 B
Text
Executable file
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))
|