This little piece of code tricked me:
if value < big(2^32)
println("Finished!")
break
end
The println was never executed and couldn't find the problem for about 3
minutes when I tried it on a 64 bit OS, where it worked.
The problem is that on 32-bit OS 2^32 equals to zero. I'm just getting used
to Julia internals and it is not really a problem if it is apparent, but I
clearly need more time with the language to spot these kind of error.
if value < big(2)^big(32)
println("Finished!")
break
end
solve this. But this is ugly and it looks like something that can be
automated.
is there any coding style that can prevent this error? I would better
receive an overflow error (if it is turned on with a flag to the Julia
executable maybe) than a silent, never running piece of code.