{"id":255,"date":"2026-04-05T01:33:34","date_gmt":"2026-04-05T01:33:34","guid":{"rendered":"https:\/\/csguy.org\/technotes\/?p=255"},"modified":"2026-04-07T19:35:48","modified_gmt":"2026-04-07T19:35:48","slug":"pi-to-4000-digits-on-a-apple-e","status":"publish","type":"post","link":"https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/","title":{"rendered":"Pi to 4000 digits on a Apple \/\/e"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Did you know that before computers humans only knew the first 100 digits of Pi. The ENIAC computer took it to about 2000 digits in the 1950s. Today large, clustered, super computers can exceed a million digits. As a challenge to myself I wanted to see how far I could go with an Apple \/\/e and 64KB of memory. Memory footprint is key so I eliminated DOS and wrote the code in 6502 assembly. With 128KB and bank swapping I could take it to 8000 digits but I&#8217;ll leave that for someone else. With 16 bit addressing and the Rabinowitz-Wagon algorithm you might be able to get to 10,000 digits but to go further requires a MUCH more complicated algorithm difficult to decompose in to small chunks on an Apple \/\/e.  Below is the source code, the assembly listing, and the output from the 4000 digit execution.  Oh, and these calculations take a long time!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/PI.pdf\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"303\" height=\"501\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/piout.jpg?resize=303%2C501&#038;ssl=1\" alt=\"\" class=\"wp-image-259\" srcset=\"https:\/\/i0.wp.com\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/piout.jpg?w=303&amp;ssl=1 303w, https:\/\/i0.wp.com\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/piout.jpg?resize=181%2C300&amp;ssl=1 181w\" sizes=\"auto, (max-width: 303px) 100vw, 303px\" \/><\/a><figcaption class=\"wp-element-caption\">Output from running the program<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/PI4000.txt\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"775\" height=\"983\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/pisrc.jpg?resize=775%2C983&#038;ssl=1\" alt=\"\" class=\"wp-image-260\" srcset=\"https:\/\/i0.wp.com\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/pisrc.jpg?w=775&amp;ssl=1 775w, https:\/\/i0.wp.com\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/pisrc.jpg?resize=237%2C300&amp;ssl=1 237w, https:\/\/i0.wp.com\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/pisrc.jpg?resize=768%2C974&amp;ssl=1 768w\" sizes=\"auto, (max-width: 775px) 100vw, 775px\" \/><\/a><figcaption class=\"wp-element-caption\">Source Listing<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/PI4000.pdf\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"590\" height=\"707\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/piasm.jpg?resize=590%2C707&#038;ssl=1\" alt=\"\" class=\"wp-image-261\" srcset=\"https:\/\/i0.wp.com\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/piasm.jpg?w=590&amp;ssl=1 590w, https:\/\/i0.wp.com\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/piasm.jpg?resize=250%2C300&amp;ssl=1 250w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/a><figcaption class=\"wp-element-caption\">Assembler Output<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/csguy.org\/mymedia\/PI.woz\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"225\" height=\"225\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/download.png?resize=225%2C225&#038;ssl=1\" alt=\"Download .WOZ disk image\" class=\"wp-image-269\" srcset=\"https:\/\/i0.wp.com\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/download.png?w=225&amp;ssl=1 225w, https:\/\/i0.wp.com\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/download.png?resize=150%2C150&amp;ssl=1 150w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Did you know that before computers humans only knew the first 100 digits of Pi. The ENIAC computer took it to about 2000 digits in the 1950s. Today large, clustered, super computers can exceed a million digits. As a challenge to myself I wanted to see how far I could go with an Apple \/\/e [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-255","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Pi to 4000 digits on a Apple \/\/e - Tech Notes<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Pi to 4000 digits on a Apple \/\/e - Tech Notes\" \/>\n<meta property=\"og:description\" content=\"Did you know that before computers humans only knew the first 100 digits of Pi. The ENIAC computer took it to about 2000 digits in the 1950s. Today large, clustered, super computers can exceed a million digits. As a challenge to myself I wanted to see how far I could go with an Apple \/\/e [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/\" \/>\n<meta property=\"og:site_name\" content=\"Tech Notes\" \/>\n<meta property=\"article:published_time\" content=\"2026-04-05T01:33:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-07T19:35:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/piout.jpg\" \/>\n<meta name=\"author\" content=\"barry hills\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"barry hills\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/pi-to-4000-digits-on-a-apple-e\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/pi-to-4000-digits-on-a-apple-e\\\/\"},\"author\":{\"name\":\"barry hills\",\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/#\\\/schema\\\/person\\\/89e2d600fe21bcb92d502289e27831a4\"},\"headline\":\"Pi to 4000 digits on a Apple \\\/\\\/e\",\"datePublished\":\"2026-04-05T01:33:34+00:00\",\"dateModified\":\"2026-04-07T19:35:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/pi-to-4000-digits-on-a-apple-e\\\/\"},\"wordCount\":165,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/pi-to-4000-digits-on-a-apple-e\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/piout.jpg\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/csguy.org\\\/technotes\\\/pi-to-4000-digits-on-a-apple-e\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/pi-to-4000-digits-on-a-apple-e\\\/\",\"url\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/pi-to-4000-digits-on-a-apple-e\\\/\",\"name\":\"Pi to 4000 digits on a Apple \\\/\\\/e - Tech Notes\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/pi-to-4000-digits-on-a-apple-e\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/pi-to-4000-digits-on-a-apple-e\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/piout.jpg\",\"datePublished\":\"2026-04-05T01:33:34+00:00\",\"dateModified\":\"2026-04-07T19:35:48+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/#\\\/schema\\\/person\\\/89e2d600fe21bcb92d502289e27831a4\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/pi-to-4000-digits-on-a-apple-e\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/csguy.org\\\/technotes\\\/pi-to-4000-digits-on-a-apple-e\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/pi-to-4000-digits-on-a-apple-e\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/csguy.org\\\/technotes\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/piout.jpg?fit=303%2C501&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/csguy.org\\\/technotes\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/piout.jpg?fit=303%2C501&ssl=1\",\"width\":303,\"height\":501,\"caption\":\"Screenshot\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/pi-to-4000-digits-on-a-apple-e\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Pi to 4000 digits on a Apple \\\/\\\/e\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/#website\",\"url\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/\",\"name\":\"Tech Notes\",\"description\":\"Sharing the tech\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/#\\\/schema\\\/person\\\/89e2d600fe21bcb92d502289e27831a4\",\"name\":\"barry hills\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e7df4c371d55904f1d858a9d27549d002b93713cd2f13d672c3c0898efcb70b4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e7df4c371d55904f1d858a9d27549d002b93713cd2f13d672c3c0898efcb70b4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e7df4c371d55904f1d858a9d27549d002b93713cd2f13d672c3c0898efcb70b4?s=96&d=mm&r=g\",\"caption\":\"barry hills\"},\"url\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/author\\\/barry\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Pi to 4000 digits on a Apple \/\/e - Tech Notes","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/","og_locale":"en_US","og_type":"article","og_title":"Pi to 4000 digits on a Apple \/\/e - Tech Notes","og_description":"Did you know that before computers humans only knew the first 100 digits of Pi. The ENIAC computer took it to about 2000 digits in the 1950s. Today large, clustered, super computers can exceed a million digits. As a challenge to myself I wanted to see how far I could go with an Apple \/\/e [&hellip;]","og_url":"https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/","og_site_name":"Tech Notes","article_published_time":"2026-04-05T01:33:34+00:00","article_modified_time":"2026-04-07T19:35:48+00:00","og_image":[{"url":"https:\/\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/piout.jpg","type":"","width":"","height":""}],"author":"barry hills","twitter_card":"summary_large_image","twitter_misc":{"Written by":"barry hills","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/#article","isPartOf":{"@id":"https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/"},"author":{"name":"barry hills","@id":"https:\/\/csguy.org\/technotes\/#\/schema\/person\/89e2d600fe21bcb92d502289e27831a4"},"headline":"Pi to 4000 digits on a Apple \/\/e","datePublished":"2026-04-05T01:33:34+00:00","dateModified":"2026-04-07T19:35:48+00:00","mainEntityOfPage":{"@id":"https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/"},"wordCount":165,"commentCount":0,"image":{"@id":"https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/#primaryimage"},"thumbnailUrl":"https:\/\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/piout.jpg","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/","url":"https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/","name":"Pi to 4000 digits on a Apple \/\/e - Tech Notes","isPartOf":{"@id":"https:\/\/csguy.org\/technotes\/#website"},"primaryImageOfPage":{"@id":"https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/#primaryimage"},"image":{"@id":"https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/#primaryimage"},"thumbnailUrl":"https:\/\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/piout.jpg","datePublished":"2026-04-05T01:33:34+00:00","dateModified":"2026-04-07T19:35:48+00:00","author":{"@id":"https:\/\/csguy.org\/technotes\/#\/schema\/person\/89e2d600fe21bcb92d502289e27831a4"},"breadcrumb":{"@id":"https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/#primaryimage","url":"https:\/\/i0.wp.com\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/piout.jpg?fit=303%2C501&ssl=1","contentUrl":"https:\/\/i0.wp.com\/csguy.org\/technotes\/wp-content\/uploads\/2026\/04\/piout.jpg?fit=303%2C501&ssl=1","width":303,"height":501,"caption":"Screenshot"},{"@type":"BreadcrumbList","@id":"https:\/\/csguy.org\/technotes\/pi-to-4000-digits-on-a-apple-e\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/csguy.org\/technotes\/"},{"@type":"ListItem","position":2,"name":"Pi to 4000 digits on a Apple \/\/e"}]},{"@type":"WebSite","@id":"https:\/\/csguy.org\/technotes\/#website","url":"https:\/\/csguy.org\/technotes\/","name":"Tech Notes","description":"Sharing the tech","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/csguy.org\/technotes\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/csguy.org\/technotes\/#\/schema\/person\/89e2d600fe21bcb92d502289e27831a4","name":"barry hills","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e7df4c371d55904f1d858a9d27549d002b93713cd2f13d672c3c0898efcb70b4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e7df4c371d55904f1d858a9d27549d002b93713cd2f13d672c3c0898efcb70b4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e7df4c371d55904f1d858a9d27549d002b93713cd2f13d672c3c0898efcb70b4?s=96&d=mm&r=g","caption":"barry hills"},"url":"https:\/\/csguy.org\/technotes\/author\/barry\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/posts\/255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/comments?post=255"}],"version-history":[{"count":10,"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/posts\/255\/revisions"}],"predecessor-version":[{"id":272,"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/posts\/255\/revisions\/272"}],"wp:attachment":[{"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/media?parent=255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/categories?post=255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/tags?post=255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}