(1) It is very important to also use ((double)x)*x instead of (double)(x*x), as the loss of precision starts to occur at far greater values than overflow occurs if one were doing integer arithmetic
IIRC Java shares also the C behaviour in that n*n becomes negative instead of signalling an overflow. If this is embedded in a complicated expression you only notice strange results, or not even that. This can be quite hard to debug.
I'm too lazy to run a test to confirm this right now, but I'm sure someone else will have done it when I wake up tomorrow :-)
J.Pietschmann
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
