Arne said:
Peter said:
Arne Vajhøj wrote:
[...]
A negative number is _clearly_ an
incorrect result of taking the absolute value of some number.
It is not really incorrect. It works as specified in the documentation.
You misunderstand my words. Mathematically, the absolute value of
some number is always non-negative. A negative result is "clearly
incorrect".
[..]
But the fact remains, if one is _actually_ taking the absolute value
of some number, it's an incorrect result to produce a negative
number. That's fundamental to the concept of "absolute value".
Programming is programming. Code that works as it is intended is
correct code.
I'm not sure how many times I need to write "you misunderstand my words"
before you realize that you misunderstand my words. I suppose I'll keep
trying though.
"...taking the absolute value of some number" isn't something that Sun
or anyone else has the luxury of redefining. It has a single, specific,
mathematical definition, completely independent of the Java specifications.
Nowhere in my statement that I ever mention the word "code". But yes,
code that _claims_ to be producing the absolute value of some number but
which can return a negative result is incorrect code.