software/c-firmware/selftest.c
/*
* First check: A naive way to compute prime numbers
*/
First check: A naive way to compute prime numbers
First check : A naive way to compute prime numbers
int isPrime(int candidate) {
    int test = (candidate/2)+1;
    while(--test > 1) {
        if((candidate / test) * test == candidate) {
            return 0;
        }
    }
    return 1;
}
int isPrime ( int candidate ) { int test = ( candidate / 2 ) + 1 ; while ( -- test > 1 ) { if ( ( candidate / test ) * test == candidate ) { return 0 ; } } return 1 ; }
First check: A naive way to compute prime numbers
First check : A naive way to compute prime numbers