Update math/magic_number.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
Neha Hasija 2020-10-27 06:33:29 +05:30 committed by GitHub
parent 69cacbc88b
commit 806f3251ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,7 +34,7 @@ bool magic_number(const uint64_t &n) {
return false; return false;
} }
// result stores the modulus of @param n with 9 // result stores the modulus of @param n with 9
int result = n % 9; uint64_t result = n % 9;
// if result is 1 then the number is a magic number else not // if result is 1 then the number is a magic number else not
if (result == 1) { if (result == 1) {
return true; return true;