Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Some Programming Fun

Featured Replies

  • Moderator

Here's a short C routine that will (eventually) print a googolplex, that is 10^googol power.A googol, for those who may not remember is simply 10^100 power, or 1 followed by 100 zeros.Now, given today's processor speeds, how long would it take to complete printing? :)#include #include int main (int argc, char *argv[]){ int *vals, *ptr, max; if (argc == 2) max = atoi (argv[1]); else max = 100; printf ("1"); if ((vals = malloc ((max + 1) * sizeof (int))) == NULL) { fprintf (stderr, "Error allocating memory.n"); return 1; } memset (vals, '0', (max + 1) * sizeof (int)); while (!vals[max]) { *(ptr = vals) += 1; while (*ptr == 10) { *ptr++ = 0; *ptr += 1; } printf ("0"); } printf ("n"); free (vals); return 0;}http://fpx.de/fp/Fun/Googolplex/

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author
  • Moderator

The fastest available desktop computers of today will run the program at a speed that allows the printing of about 10 to the power of 7 digits per second. The average year has roughly 3.2*10^7 seconds, so this machine will print about 3.2*10^14 digits per year. We conclude that this machine will need 3.125*10^85 years to finish printing Googolplex. Lucas Watson ([email protected]) took a different approach, and pointed out that this program will be useless even in a million years, simply because there isn't enough matter (in the universe) to print a Googolplex on (and this fact is unlikely to change). According to him, this idea originated on Carl Sagan's Cosmos TV show. Of course printing a Googolplex in base Googolplex is easy:If we switch to base Googolplex, you can print it simply as 10

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.