{"id":13613,"date":"2016-12-17T13:51:31","date_gmt":"2016-12-17T18:51:31","guid":{"rendered":"http:\/\/scruss.com\/blog\/?p=13613"},"modified":"2016-12-17T13:51:31","modified_gmt":"2016-12-17T18:51:31","slug":"fun-things-you-learn-from-old-computers","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2016\/12\/17\/fun-things-you-learn-from-old-computers\/","title":{"rendered":"Fun things you learn from old computers \u00e2\u20ac\u00a6"},"content":{"rendered":"<figure id=\"attachment_13614\" aria-describedby=\"caption-attachment-13614\" style=\"width: 512px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/12\/Decimal_vs_Binary_BASIC.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-13614 size-full\" src=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/12\/Decimal_vs_Binary_BASIC.png\" width=\"512\" height=\"384\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/12\/Decimal_vs_Binary_BASIC.png 512w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/12\/Decimal_vs_Binary_BASIC-160x120.png 160w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/12\/Decimal_vs_Binary_BASIC-320x240.png 320w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><figcaption id=\"caption-attachment-13614\" class=\"wp-caption-text\">The program on the left is running on the decimal interpreter, the one on the right the regular one<\/figcaption><\/figure>\n<p>Microsoft used to supply two versions of its BASIC for Macintosh. One used decimal mathematics for precise tallying of small amounts. The other used the more familiar floating point mathematics, rounding errors and all. I don&#8217;t know what floating point library Microsoft used for sure \u00e2\u20ac\u201d perhaps Motorola&#8217;s 32-bit Fast Floating Point system \u00e2\u20ac\u201d but it introduces rounding errors pretty quickly. Modern routines don&#8217;t start displaying oddly until after 15 decimal places.<\/p>\n<p>Consider this simple program:<\/p>\n<pre>10 LET x=36\/10\r\n20 LET a$=\"## #.#\"\r\n30 FOR n%=1 TO 18\r\n40 PRINT USING a$; n%; x\r\n50 LET a$=a$+\"#\"\r\n60 NEXT n%\r\n70 END<\/pre>\n<p>Along with the number of decimal places, it should print 3.6, 3.60, 3.600, 3.6000, \u00e2\u20ac\u00a6 with an increasing line of zeroes after the 3.6. <a href=\"http:\/\/www.moria.de\/~michael\/bas\/\">Bas<\/a> makes a valiant but typical attempt:<\/p>\n<pre> 1 3.6\r\n 2 3.60\r\n 3 3.600\r\n 4 3.6000\r\n 5 3.60000\r\n 6 3.600000\r\n 7 3.6000000\r\n 8 3.60000000\r\n 9 3.600000000\r\n10 3.6000000000\r\n11 3.60000000000\r\n12 3.600000000000\r\n13 3.6000000000000\r\n14 3.60000000000000\r\n15 3.600000000000000\r\n16 3.6000000000000001\r\n17 3.60000000000000009\r\n18 3.600000000000000089\r\n<\/pre>\n<p>Oddly enough, good old Locomotive BASIC on the Amstrad CPC does it more correctly somehow:<\/p>\n<p><a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/12\/Screenshot-from-2016-12-17-13-28-58.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13615\" src=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/12\/Screenshot-from-2016-12-17-13-28-58.png\" alt=\"\" width=\"768\" height=\"568\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/12\/Screenshot-from-2016-12-17-13-28-58.png 768w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/12\/Screenshot-from-2016-12-17-13-28-58-160x118.png 160w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/12\/Screenshot-from-2016-12-17-13-28-58-320x237.png 320w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a>So the variables, they vary.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft used to supply two versions of its BASIC for Macintosh. One used decimal mathematics for precise tallying of small amounts. The other used the more familiar floating point mathematics, rounding errors and all. I don&#8217;t know what floating point library Microsoft used for sure \u00e2\u20ac\u201d perhaps Motorola&#8217;s 32-bit Fast Floating Point system \u00e2\u20ac\u201d but [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[2062,269,2556],"class_list":["post-13613","post","type-post","status-publish","format-standard","hentry","category-computers-suck","tag-basic","tag-mac","tag-retrocomputing"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-3xz","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/13613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=13613"}],"version-history":[{"count":1,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/13613\/revisions"}],"predecessor-version":[{"id":13616,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/13613\/revisions\/13616"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=13613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=13613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=13613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}