I am working on some ancient Delphi code, and I came across something that I do not quite understand.
[bla is set to 130245932] outresult := ((bla * 1103516849) + 12359); [outresult is equal to -413953101]
How does multiplying two positive numbers result in a negative number? And why does this happen when I take the bla variable from the equation and just use the integer directly (like this)
outresult := ((130245932 * 1103516849) + 12359);
I get an error before the application even compiles
[DCC Error] Unit1.pas(60): E2099 Overflow in conversion or arithmetic operation
Some geniuses will be appreciated. Thanks.
source share