maths: matrix.is_magic should check for integers

This commit is contained in:
Danny Robson 2014-07-07 15:17:16 +10:00
parent 5c030bf0ea
commit 6e2a78fc3b

View File

@ -246,7 +246,8 @@ matrix::is_magic (void) const {
double a = (*this)[i][j],
b = (*this)[j][i];
if (!exactly_zero (a) || !exactly_zero (b))
if (!exactly_equal (static_cast<uintmax_t> (a), a) ||
!exactly_equal (static_cast<uintmax_t> (b), b))
return false;
if (!numbers.contains (a) ||