diff --git a/caesar/caesar.js b/caesar/caesar.js index b6dcd95..a4d935a 100644 --- a/caesar/caesar.js +++ b/caesar/caesar.js @@ -7,8 +7,9 @@ const caesar = function(string, shiftValue) { const codeSet = code => (code < 97 ? 65 : 97); -// this function is just a fancy way of doing % so that it works with negative numbers -// see this link for details: +// This function implements a version of the modulo operator +// that returns the smallest positive remainder even for negative inputs. +// See this link for details: // https://stackoverflow.com/questions/4467539/javascript-modulo-gives-a-negative-result-for-negative-numbers const mod = (n, m) => (n % m + m) % m;