Les Morgan, welcome to the Ranch
There are four arithmetic problems you need to worry about:-
1: Integer overflow, as in this thread earlier today.2: Floating‑point overflow, which will give ∞ as a result.3: Floating‑point underflow, which will give you 0.0 as a result.4: Floating‑point imprecision, which can produce all sorts of nasty errors from a tiny difference from the expected result.Division by 0 varies depending on whether you are using BigDecimal, integers or floating‑point numbers.
When I first started programming, it was all about complicated arithmetic, but now I am surprised by how little arithmetic you need to program.
I find I have a difference of opinion about whether programming is a branch of mathematics or of engineering. I usually think of it an engineering where one is trying to make something. But other people think all programming is maths.