Re: "Neagtive overflow" & other flaws in binary operations.

2017-03-12 Thread Eduardo Bustamante
On Sun, Mar 12, 2017 at 4:15 AM, wrote: > Hello, > > Recently I've tried to use BASH to do some binary operations, that task > turned out to be far more difficult, that I could ever imagined. Bash has limited support for arithmetic operations on fixed width signed integer numbers. Furthermore, i

"Neagtive overflow" & other flaws in binary operations.

2017-03-12 Thread ma9ik
Hello, Recently I've tried to use BASH to do some binary operations, that task turned out to be far more difficult, that I could ever imagined. First of all, I've found out that 2 shifted to the left edge of boundary (2**63) produces as a result a negative number "-9223372036854775808" ("funny"