in reply to perl arithmetic is killing me! HELP!
& only works on numbers that fit in an IV (a signed integer type) or UV (an unsigned integer type). This range is -2,147,483,648..4,294,967,295 for you. Without use integer;, 872_415_232 + 4_278_190_080 produces a number larger than that, so & produces junk. Specifically, it returns the largest UV (4,294,967,295 for you), which %d casts to an IV (-1).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl arithmetic is killing me! HELP!
by harangzsolt33 (Deacon) on Nov 07, 2018 at 15:50 UTC | |
by ikegami (Patriarch) on Nov 07, 2018 at 17:38 UTC |