Retired

Prime numbers are Prime! (retired)

Description
Loading description...
Fundamentals
Algebra
Mathematics
Algorithms
Logic
Loops
Control Flow
Basic Language Features
Numbers
Data Types
  • Please sign in or sign up to leave a comment.
  • luisafvaca Avatar

    passed all test but..show the message " Correct! You may take your time to refactor/comment your solution. Submit when ready."

  • vinylhero Avatar

    Some spelling mistakes on the word 'divided' spelt here as 'devided'.

    Also, may want to add some tests and explanaition for non-whole numbers. I know most people use 2 as their fail point but if you put 2.1 under your conditions this would be a prime number when it is c;early not.

  • eirkeirkeirk Avatar

    test output doesn't show values that are tested.

  • everett980 Avatar

    This comment has been hidden.

  • AndreKirchner Avatar

    Should first of all try easy examples, such as 9, 15, 21 etc. Most of the solutions only check for modulo 2, which only checks for odd/even.

  • PunkSage Avatar

    Some solutions posted but other are incorrect, but they were able to pass the test.

  • deepakssn Avatar

    Get unresponsive scrpt error multiple times. Have to stop script and reload page.

  • jmcshane Avatar

    Terrible description. Should rewrite altogether

  • AndreiAusianik Avatar

    function PrimeTest(a){ return a>0 && a%2 >= 1 ?true:false; }; is the solution for this task. add more test to prevent this.

  • coldcandor Avatar

    1 significant problem, as illustrated by the top solution - your tests only have false cases that are negative or even. You need far more tests to prove a valid function. Consider a random test generator paired with a known-to-be-accurate solution, combined with several non-even false primes.

  • Phil0u Avatar

    You have to write more test case with real prime number like 2,3,5,7.

  • RLao-Yoga Avatar

    not sure why i'm prompted to refactor my solution. It works...

  • gridlockprime Avatar

    In the Instructions there is a typo: 'devided' should read 'divided'.

  • GaurangTandon Avatar

    This comment has been hidden.

  • itsashis4u Avatar

    There is a TYPO ! Its divide not devide.

  • GiacomoSorbi Avatar

    Check for the example cases: -17 is not a prime because is negative, period. And I presume "devided" is mispelled, as only "divided" should be a good form.

    More and random test would be highly appreciated.

  • sad Avatar

    -17 is a prime, so -17 should be evaluated as true.

  • jgdodson Avatar

    Need more test cases. I saw a solution which passed even though it considered 1 to be non-prime. Also, the description needs clarification. You define a prime number as being a natural number (therefore positive), and yet one of the examples states that -17 is non-prime because it is divisible by -1.