Built in prime checking function
c++
Solution
Short answer: no, there's no such function.
The only time the word "prime" is used in the standard is a footnote in 26.5.3.2, which is where the `mersenne_twister_engine` class template is described. The footnote says:
274) The name of this engine refers, in part, to a property of its period: For properly-selected values of the parameters, the period is closely related to a large Mersenne prime number.
If such function existed, the standard would contain more occurrences of that word, as it would use it to describe the behavior of that function.
Problem
Does C++ have any built in function to check if the number is prime or not. If yes, then in which library? Below is my implementation. But was just looking if there is any built in function. Searching on Google just gives user based implementations. ``` int isprime(int N){ if(N<2 || (!(N&1) && N!=2)) return 0; for(int i=3; i*i<=N; i+=2){ if(!(N%i)) return 0; } return 1; } ```