From 6e2a78fc3b83b88bf9d3553cbd95eb8996465c68 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 7 Jul 2014 15:17:16 +1000 Subject: [PATCH] maths: matrix.is_magic should check for integers --- maths/matrix.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/maths/matrix.cpp b/maths/matrix.cpp index c64cb0b3..7af9e8b8 100644 --- a/maths/matrix.cpp +++ b/maths/matrix.cpp @@ -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 (a), a) || + !exactly_equal (static_cast (b), b)) return false; if (!numbers.contains (a) ||