Code, Strings, and Keys

    • About Thomas Powell
    • Account
    • It’s been [0] days since [program] last updated
    • Login
    • Password Reset
    • Pianist / Accompanist / Music Director Resume
    • Reading List 2025
    • Register
    • Running Gear – Shoes, Treadmill, and Bandages
    • Site Map
Illustration of a bird flying.
  • Optimized prime number generator

    Same specs as previous system, 8 hours to find all primes to ULONG_MAX. #include <stdio.h>#include <malloc.h>#include <limits.h>#include <math.h>struct linked_list{ unsigned long number; struct linked_list *next;};int main(int argc, char **argv){ unsigned long divisor, max_divisor, prime_test; unsigned long max_prime_to_store; struct linked_list *first=NULL, *current=NULL, *last=NULL; first=(struct linked_list *)malloc(sizeof(struct linked_list)); first->number = 2L; first->next = NULL; last = first;…

    July 20, 2008
  • Nice little “rural” Fern Creek run.

    Crossed paths of cyclists on Seatonville Rd five times this morning. Most of them were pleasant, one of them was a bit anti-social. I’ve decided that my favorite drivers are in the 60+ age group and drive 10+ year old pickup trucks in very good condition. Generally, these drivers pass carefully with a decent amount…

    July 19, 2008
  • I miss C programming. Program to find prime numbers

    Uses unsigned long long, goes up to ULONG_LONG_MAX. Intel Core Duo 2 processor, running Cygwin on Windows XP, and compiled using gcc 3.4.4. Stops at first million results due to time. Can reasonably get to 10 million, if you’re willing to wait. #include <stdio.h>#include <math.h>#include <limits.h>int main(int argc, char **argv){ unsigned long long divisor, max_divisor,…

    July 18, 2008
←Previous Page
1 … 253 254 255 256 257 … 317
Next Page→

Code, Strings, and Keys

Proudly powered by WordPress