4 ms·
SQL NULL. Javascript NaN. Their behaviour is defined by the standards and special checks are required to identify these values properly. In SQL, it's X IS (
by DCoder 16y ago
SQL NULL. Javascript NaN.
Their behaviour is defined by the standards and special checks are required to identify these values properly.
In SQL, it's
X IS (NOT) NULL
, in Javascript it'd be
isNaN(X)
.
rand() (well, most of the time[1]). This you just have to know :)
Improperly expanding C macros:
#define isupper(c) ((c) >= 'A' && (c) <= 'Z')
#define X isupper(getchar())
printf("X == X = %d\n", X == X);
And like lurker14 said, anything in general that has side-effects.
[1] It is possible rand() will return the same value twice in a row, just not very likely. Also the original author might have been twisted enough to memoize it. Thank you, "Higher order Perl", for that idea.