algorithm: sieve (#1205)

This commit is contained in:
ddaniel27
2022-10-20 06:20:37 -05:00
committed by GitHub
parent 55f502e1f1
commit 0084acf2d4
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,12 @@
import { sieveOfEratosthenes } from '../SieveOfEratosthenesIntArray'
import { PrimeCheck } from '../PrimeCheck'
describe('should return an array of prime numbers', () => {
it('should have each element in the array as a prime numbers', () => {
const n = 100
const primes = sieveOfEratosthenes(n)
primes.forEach(prime => {
expect(PrimeCheck(prime)).toBeTruthy()
})
})
})