johsteffens / primes

Simple prime generator in C, Python and Actinon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Simple prime generator in C, Python and Actinon

License:MIT License


Languages

Language:C 63.5%Language:Python 36.5%