Qt C++ Modulo Operator Failing -
this question has answer here:
this simple issue overlooking. writing in c++ on qt , working on ciphers. have use %26
in order them working. tested this: qdebug() << (6-18)%26;
, according internet , math, should produce me number 14, right? no. -12 6-18 is, don't know if modulo isn't being applied of what. appreciated.
you right on this: 6-18 = -12
when divide: -12/26 = 0.46
with modulus = 4
i hope you.
Comments
Post a Comment