More Oyster Woes ...
"Dr J R Stockton" wrote in message
nvalid...
In uk.transport.london message
ernal-september.org, Thu, 28 Oct 2010 17:35:20, Sam Wilson
posted:
In article id,
Dr J R Stockton wrote:
...
In JavaScript, where Numbers are Doubles, one does it by taking the
reciprocal. Plus infinity and minus infinity are easily told apart.
The internal sign of a Number X (that is not NaN) can be determined by
comparing X + 1/X with a zero. Min(Abs(X+1/X)) = 2, at least for real
numbers.
Yeah, but you can't say something like
if (result == +0)
{
...
}
else if (result == -0)
{
...
}
can you?
Sam
and have it operate differently from
In JavaScript, float +0 and -0 are arithmetically equal in value, but
their reciprocals differ. Integer operations are 32-bit 2's complement;
+0 & -0 convert to the same Hex value, 00000000. It's all in ECMA 262
5th Edn, free PDF.
Yeah, but how does it define N,S,E,W,Up & Down..:-)
--
Cheers, Steve.
To reply, replace the rodent with the unsullied maiden.
|