Closed
Bug 114761
Opened 23 years ago
Closed 23 years ago
trivial never-false conditions in Rhino shell
Categories
(Rhino Graveyard :: Compiler, defect)
Tracking
(Not tracked)
VERIFIED
INVALID
1.5R3
People
(Reporter: rokicki, Assigned: norrisboyd)
Details
The following code appears twice in tools/shell/Main.java:
double d = cx.toNumber(args[i]);
if (d != d)
usage(arg);
It is probably intended to be
if (d != (int)d)
-tom
Assignee | ||
Comment 1•23 years ago
|
||
Actually, this is correct code. For a double d, the expression d != d is true
iff d is a NaN. The NaN value is what is returned if there is an invalid string
passed into Context.toNumber.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•