The following Javascript code executed in Java 8 (Nashorn) does not work properly:
if( a != b ) { do_sth(); }
a and b are long values ββcoming from a Java object (e.g. 1023948, 1023949). For example, when a = 1023949 and b = 1023949, a! = B is true.
Please note that the following code works fine:
if( (a+0) != (b+0) ) { do_sth(); }
I know about the problem with long precision (since the Javascript numbers are 64 doubles), but I expected the "small" long values ββto work.
Any input is appreciated. thanks.
source share