java - What does "if (double)" do in C++ -
i can't seem figured out, or made work somewhere in code bug...
my question is, can translate c++ code
if (!fmod(x[i][j], 1) && x[i][j]) {
to java equivelent. variable x has doubles in it's list.
thanks alot help!
if (x[i][j] % 1 == 0 && x[i][j] != 0 ) {
java doesn't automatic coercions boolean type, have make boolean values !=
, ==
, etc. checks double @ x[i][j]
non-zero whole number. (in c++, non-zero true
, 0 false
.)
Comments
Post a Comment