On Sun, Mar 11, 2018 at 10:48 PM, C.J. Slade via vcf-midatlantic < vcf-midatlantic@lists.vintagecomputerfederation.org> wrote:
Hi VCF,
Connor S has come the last 2 workshops at VCF with his Dad and loves working on vintage computers. He has been working on the 5th Grade Science Fair project for the past few months. Connor is comparing vintage to modern computers and has been researching and testing the Altair 8800 (clone), Apple II GS, Macintosh SE, iBook G3, Commodore 128 & Mac Book Air. He would like to add the C-64, PET & VIC-20, but doesn't have access to run tests.
Would someone be willing to run the following 3 tests on the *Commodore 64*, *Commodore PET *and *Commodore VIC-20 *this week for Connor to include in his results?
Hi Jen, might I suggest two items plus some insight into computer arithmetic used on these 8 bit home computers as background info. And why it was beneficial to use mainframe computers to calculate Factorials higher than 33! Your son is welcome to use this info now, maybe condense it, or maybe in a future project the 1st item , I noticed his project spans about 3 decades of vintage computers Another prominent platform to consider is CP/M v2.2 [also 8 bit computers] There were many computers made in the 70s and 80s using this Operating System. This was way before Windows and Macintosh, and it's version was called MBASIC I ran a test last night on my Kaypro 2 and noticed the same limitation at 33! I can forward the results to your email addr the 2nd item, Then I recalled something which your son might want to include in his discussion, not only is the limitation on many of the 8 bit home computers using only BASIC is at 33! which is mainly due to them having only single precision arithmetic. but there's also a flaw in the Microsoft BASIC used on CP/M limiting this calculation at 33! CP/M was expected to be more advanced than generic home computers. While CP/M was made by Digital Research, and a very elaborate OS for it's day, some of the programming languages were made by Microsoft. Background info, Even though Factorials typically deal with Integers, it's also possible for real numbers too, but that's for another day. When the answer exceeds the range of Integers possible on 8 bit home computers, the BASIC program begins to print the answer in scientific notation, when the value gets higher and higher while calculating 33! As it doesn't limit the range for variables while the program is running. Computer Arithmetic, But this scientific notation is only available as single-precision arithmetic. This is one form of computer arithmetic made available on these 8 bit home computers. The range of numbers possible with this form are between 10E-38 to 10E+38. If you notice the final answer in 33!, it's already near the end of range at 8.6E+36. But when you try 34!, then the answer goes over the range limit of 10E+38 and causes an overflow error. Some technical background, There are basically 3 data types for variables in these 8 bit home computers Many of the 8 bit home computers which only have BASIC contain just the first 2 data types #1.Integers, #2.Floating Point Single Precision, and #3.Floating Point Double Precision Data Types, And this is how much memory is used for these different variable types. #1.Integers = 2 data bytes per variable, decimal values -32768 to +32768 #2.Single Precision = 4 data bytes per variable, decimal values 10E-38 to 10E+38 #3.Double Precision = 8 data bytes per variable, decimal values 10E-308 to 10E+308 Double Precision Arithmetic, Normally when you expect a computer to offer double precision arithmetic, as with mainframe computers, not only does it give you more decimal places to be precise, but that range in numbers to give you an answer will also be much higher, so you can calculate factorials much larger than 33! That range of numbers now for double-precision arithmetic is between 10E-308 to 10E+308. The Flaw, The flaw in CP/M BASIC is on the 3rd data type. CP/M MBASIC offers double precision arithmetic but not in the true fashion. Meanwhile, programming languages on mainframes in the same time period did have a good representation in using double-precision arithmetic. There was an earlier history where those mainframe companies had issues with getting that computer arithmetic standardized. But Microsoft made drastic shortcuts in their MBASIC programming language. This also affected their FORTRAN-80 language, also available on CP/M. This happened when you like to use double-precision arithmetic in MBASIC or FORTRAN-80 on CP/M. In MBASIC, you can force this to use double-precision by adding a "#" beside the variable name. Even so, the range of numbers is the same between single precision and double precision, it's still between 10E-38 to 10E+38 . So you're stuck with calculating factorials only as high as 33! This is why it never became comparable to programming as on a mainframe. There's a more detailed engineering explanation as to why this happened if you ever need this info. -- see listing below FYI, I'm curious what the results were on the MacSE and iBookG3 since these are 32 bit computers as I don't have them to experiment. But I'm betting they can calculate much larger factorials with true double-precision arithmetic. The only similar computer to the MacSE that I have is the Amiga 1000, having the same 68000 processor. I ran the experiment, and it can calculate Factorials much higher than 33!. So far, I only tried as high as 100! and it already shows true double-precision results. The answer was basically 9.3D+157. The "D" in the scientific notation denotes a double precision value. There's a special notation in Amiga BASIC, same as with MBASIC, using the "#" beside the variable name to force this to use double-precision arithmetic to calculate larger factorials - see listing below. I can send the results if you like. Dan MSBASIC on CP/M listing OR AMIGA 1000 BASIC listing ----------------------------------------------------------------------------- 10 INPUT "NUMBER= "; A# 20 B# = A# 30 B# = B# - 1 40 PRINT A# "*" B# "= "; 50 A# = A# * B# 60 PRINT A# 70 IF B# > 1 HEN GOTO 30 80 END -- _ ____ / \__/ Scotty, We Need More Power !! \_/ _\__ Aye, Cap'n, but we've only got 80 columns !!