That's exactly right, Cameron. I believe that values for infinity and negative infinity are a part of the floating-point standard that
Java uses, IEEE 754. Other aspects of
java.lang.Double might jog your imagination on this topic.
Also, I thought I'd point out that in the code sample you gave, you could also use java.lang.Double's
static method isInfinite():
(N.B., isInfinite() returns
true if "d" equals Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY.)
HTH,
Art
[This message has been edited by Art Metzer (edited May 04, 2001).]