Ad
  • Default User Avatar

    You're right! I came across this issue when I tried to use my isPrime implementation in a Kata.

  • Default User Avatar

    The following test will fail:
    Assert::That(false, Equals(PrimeNumber::isPrime(4)));

    You should replace:
    if (num % 2 == 0) return true;
    with:
    if (num == 2) return true;
    if (num % 2 == 0) return false;