From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: OO, C++, and something much better! Date: 1997/01/26 Message-ID: #1/1 X-Deja-AN: 212398119 references: <5bphq4$5js@mulga.cs.mu.OZ.AU> <32E05FAF.47BA@concentric.net> <5buodl$bci@boursy.news.erols.com> <32E2FEC7.2F7B@concentric.net> <6PE5zLpF3RB@herold.franken.de> <32E57E2B.6CB7@epix.net> <32E57FBC.2325@epix.net> <5c4ita$3qs@mulga.cs.mu.OZ.AU> <32E6797A.6E21@parcplace.com> <32e87d25.0@194.131.7.3> <32EB92E9.3C2D@parcplace.com> organization: New York University newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.c++,comp.lang.smalltalk,comp.object Date: 1997-01-26T00:00:00+00:00 List-Id: "Hmmm. ABC sounds interesting, but from the description above, this does not sound like a capability that it has that Smalltalk does not have as well. Smalltalk can also do infinite precision arithmetic using its built-in Fraction class. I too have seen the pi example described above written in a few lines of Smalltalk code." As far as I know the fraction class in ST is just a straigntforward implementation of rational arithmetic. The advantage of the continued fraction approach is that you can get arbitrary precision for irrational numbers. For example it is fine to write the sqrt (2.0) in ABC, and this is *exactly* the square root of 2. If you print out this value, it will print out an infinite number of digits, and take an infinite amount of time to do it. You can however say give me the first N digits (or more precisely there is a truncation operator that says, truncate this value to N decimal digits, and then you can output the truncated value.