Julia Integer
types have a minimum and maximum value.
When calculations go beyond those boundaries, results are 'incorrect'.
for i in Int8[5, 10, 15, 20]
println(i, " -> ", i^2)
end
Result:
5 -> 25
10 -> 100
15 -> -31
20 -> -112
Is there an efficient way in Julia to raise an exception when this occurs?
This to prevent this from happening without noticing.
Maybe there are better solutions than raising an exception.