Integer overflow: Difference between revisions

m
→‎{{header|Phix}}: added try/catch note
(Applesoft BASIC)
m (→‎{{header|Phix}}: added try/catch note)
Line 1,966:
</pre>
The <b>overflow is automatically caught</b> and the program <b>does not continue</b> with the wrong results. You are always given the exact source file and line number that the error occurs on, and several editors, including Edita which is bundled with the compiler, will automatically jump to the source code line at fault. Alternatively you may declare a variable as atom and get the same performance for small integers, with seamless conversion to floats (with 53 or 64 bits of precision) as needed. Phix has no concept of unsigned numbers, except as user defined types that trigger errors when negative values are detected, but otherwise have the same ranges as above.
 
You can of course use a standard try/catch statement to avoid termination and resume processing (after the end try) and that way make a program more "robust". However a mute top-level "catch-all" that says and logs nothing will most certainly simply serve to make the program ''much harder to debug'', whereas localising all try/catch statements to cover the least possible amount of code makes it much easier to "do the right thing" should an error occur.
 
=={{header|PicoLisp}}==
7,794

edits