Skip to content

johsteffens/primes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prime generation in C, Python, Actinon

primes.c, primes.py and primes.acn do the same thing:

  • Compute all prime numbers up to including a specified maximum p_max
  • Store all primes in an array.
  • Print the largest prime <= p_max
  • Print the number of primes: Pi(p_max)

You can run them as follows:

  • gcc primes.c; a.out [p_max]
  • python primes.py [p_max]
  • actinon primes.acn [p_max]

If p_max is not specified, the routine sets p_max=1000000.

Note: Actinon is the interpreted language of the Actinon Ray Tracer.

Motivation

Analyzing syntax and runtime behavior of a simple algorithm across languages.

Releases

No releases published

Packages

No packages published