Re: Arithmetic overflow checking



On 7/23/2011 7:39 PM, supercalifragilisticexpialadiamaticonormalizeringelimatisticantations wrote:
On 23/07/2011 2:51 PM, lewbloch wrote:
David Lamb wrote:
supercalifragilisticexpialadiamaticonormalizeringelimatisticantations
wrote:
Eww. Mutable number classes.

It's what happens to ordinary ints in most machine languages. Feel free
to define the less-efficient functional versions that always generate
new objects. The main point was that the method calls aren't necessarily
all that hard to read.

The "Eww" poster seems fond of making tabloid statements devoid of
engineering reasoning.

Wrong.

Ordinary ints aren't (in Java, at least, with no "int *" type) subject
to aliasing and other problems that a mutable Integer-analogue would be.

Then I suppose you'd have no objection to making the Matrix class immutable and implicitly copying itself every time you do an operation. I really appreciate that when using Householders to find eigenvalues in my small 10Kx10K matrix.

--
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth
.