-
note
Though this C-version is much faster than Python one,
it still takes some time when the input number is significantly large.
So I tried to pre-calculate prime numbers to speed up the process
using the program, an excerption of the original, as follows:
primes_to_file.c
clang -o primes_to_file primes_to_file.c -lm ./primes_to_file 100
primes.txt
{2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97}
The output file size, however, drastically increases as the input number grows.
Therefore it is not reasonable to utilize precalculated prime numbers
because it requires considerable storage memory.
input num file size 10,000,000 10 million 5,105KB 4.98MB 100,000,000 100 million 49,902KB 48.7MB 1,000,000,000 1 billion 490,196KB 478MB 2,000,000,000 2 billion 999,104KB 975MB There is no space but a comma between numbers
This repository is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license