|
Prev: Printing from M/F COBOL
Next: Packed decimal versus binary was Re: J4 - presentation/discussion on "Future of the COBOL Standard"
From: Robert on 7 Apr 2008 22:11 On Mon, 7 Apr 2008 11:08:23 -0500, "tlmfru" <lacey(a)mts.net> wrote: >Robert <no(a)e.mail> wrote in message >news:521gv394rgj59j3d8u86clvp0a8am6857n(a)4ax.com... >> On Sat, 5 Apr 2008 10:54:00 -0600, "tlmfru" <lacey(a)mts.net> wrote: >> >> > >> >One very good reason that pure binary representation was not used is that >> >decimal fractions cannot (generally) be expressed except as a repeating >> >number in binary. Examples: 0.2 (decimal) = .00110011 ... (binary). .12 >> >(decimal) = .000111 etc. (binary). >> >> To pay for something costing .50, you don't tear a dollar bill in half (a >fraction), you >> tender 50 pennies (an integer). >> > >Nevertheless, if you're calculating what happened, you've spent half a >dollar - unless you convert ALL the figures to pennies. No conversion is necessary. Figures are already in pennies. >> >To make correct arithmetic using only binary possible, it seems to me >that >> >ALL numbers must be implicitly scaled to remove the decimal point. If >that >> >is your meaning, Robert, then you haven't made it clear. Binary >fractions >> >cannot be represented accurately - period. >> >> I did make it clear. Here's the thread: >> >> >> On Mon, 31 Mar 2008 21:55:10 -0300, Clark F Morris >> >> <cfmpublic(a)ns.sympatico.ca> wrote: >> >> >> >>>Try doing a simple divide like calculate the value of 1 / 5 in binary. >> >> >> >> OK. >> >> >> >> 01 numerator value 1 binary pic 9(9). >> >> 01 denominator value 5 binary pic 9(9). >> >> 01 quotient binary pic 9(9)v9(4). >> >> >> >> compute quotient = numerator / denominator >> >> display quotient >> >> >> >> 0000000002000 >> >> >> >>>You get a never ending fraction. >> >> >> >> Looks pretty diadic to me. >> > >> >That's because you did not do it in binary, you did it in decimal. >> >One-fifth is rational in decimal, but irrational in binary. >> >> >Nope, all three numbers are binary INTEGERS. The fallacy is in thinking >of quotient as a fraction. It is not a fraction, it is an integer. >> > The compiler SCALED two integers by multiplying by powers of 10, then >divided two binary integers to get a quotient with no fraction. >> > Binary 10 divided by binary 5 gives binary 2. >> >> >101111101011110000100000000 / 1100001101010000 = 11111010000 > >This isn't the point. The point is that with very few exceptions a decimal >number with figures on both sides of the decimal point can't be represented >as a pure binary number, as the fractional portion is almost always >non-terminating. Binary ONE divided by binary 5 gives binary .00110011..... >A scaled number is not the number itself: it's a transformation of the >original. By definition, integers are whole numbers. There is no fractional part to an integer. >Incidentally, how do you decode that string of digits? I paste it into a calculator and hit Dec. Hardware does it by doubling the answer and adding each bit, left to right. >> >Incidentally - everybody knows about the simple algoritm to convert base >10 >> >numbers to base 2 - i.e. repeated division by 2 - >> >I had some fun working out the mirror algorithm to convert decimal >FRACTIONS >> >to binary fractions. (Very easy, actually). (Both algorithms work for >any >> >base). But what puzzles me is I've never seen this written up anywhere. >> >I'm certain that the early developers of computers (or perhaps IBM >research >> >fellows) must have discovered the algorithm. Has anyone seen it written >up? It's of no use when dealing with integers, because they have no fractional part. >Very interesting! But doesn't answer my question. I'd really like to make >an original contribution to math or computer science but I can't believe >that "my algorithm" is it. Now you're in the domain of abstraction and generalization, a faux pas in these parts.
From: Robert on 7 Apr 2008 23:39 On Sun, 6 Apr 2008 02:23:46 +0000 (UTC), docdwarf(a)panix.com () wrote: >... I do not know what you acre calling 'criticizing', Mr Wagner, but as a >contractor I have said many, many times 'I believe that there could be >difficulties with this because of (reason); now that I have stated this... >what you're doing does not violate what I assume to be my set of >professional ethics nor my personal integrity so let me give you what you >are paying for.' > >When - not if - saying something like that gets my badge de-activated then >I find another job... that's what consultants/contractors/hired guns do, >or so I've seen. In my experience, there are two kinds of shops: those run by managers and those run by workers. They're split about 50-50. In the ones run by managers, refusing to do something is grounds for dismissal (as it should be). In the shops run by employee workers, the most common reason is posing a threat by being better than them. Managers want 'the best'; workers want to protect the status quo.
From: Robert on 7 Apr 2008 23:41 On Fri, 04 Apr 2008 05:52:42 GMT, "William M. Klein" <wmklein(a)nospam.netcom.com> wrote: >What compilers have dropped COMP-1 and COMP-2? I know that both IBM and Micro >Focus still support them. I saw it, but cannot recall where. It wasn't Micro Focus nor IBM mainframe. Maybe Fujitsu or i-series.
From: Richard on 8 Apr 2008 00:53 On Apr 5, 1:51 pm, Robert <n...(a)e.mail> wrote: > On Fri, 04 Apr 2008 07:50:39 -0600, Howard Brazee <how...(a)brazee.net> wrote: > >On Fri, 04 Apr 2008 00:13:23 -0600, Robert <n...(a)e.mail> wrote: > > >>You thought that because 'everyone knows' binary fractions are inaccurate. Some refuse to > >>believe the number is an integer, not a fraction. That was my whole point -- we could have > >>been storing currency amounts (dollars/pounds/zlotnys and cents) in binary all along. We > >>never needed packed decimal. It was an IBM sales gimmick, and it worked. You never had to use Pounds Shillings and Pence then. In many cases systems progressed from unit record equipment onto the new fangled computers, with hybrid systems in between. Univac 1004, IBM 1401, ICL 1500 (not the later Singer/Cogar). Some of these were BCD machines and the data tapes were written with this format. > It was an IBM sales gimmick, and it worked. It wasn't a 'gimmick', that is merely your usual ad hominem agianst IBM and mainframes, it was required to maintain data transfer with older equipment still in use and was, in fact, faster when there was a mix of IO and computation. > >Packed decimal was never marketed as a Need. It was marketed as an > >efficiency option. Saving space used to be a significant cost > >factor. > > Binary takes 20% less space in memory. and decimal takes around 100% more (on many machines). > > Also, packed decimal was (and is) significantly quicker in > >when the application wants Display and computational use of the same > >number. > > Why was it used when the application did not need both formats, which was most of the > time? > > >>If they did it in binary and got right answers, people would find out. Then the decimal > >>ruse would be discredited. > > >Most of us never saw a "ruse". Probably this was because we > >understood what packed-decimal was all about and made our choices > >accordingly. > > If you all truly understood what packed was all about, you all wouldn't have used it. Some machines were decimal only, some also used BCD. Personally I preferred S1(23) SYNC RIGHT. > >We also don't have our identity tied into understanding everything - > >so when we do find that we had a misunderstanding, we don't need to > >find someone to blame for trying to fool us. > > The brave new world would be better if people could just get along. Pointing out mistakes > is against social harmony, thus antisocial. You may have had a point if they were pointing out actual mistakes and not simply rants and ad hominem attacks against IBM, mainframers and anyone not fatuously fawning over your 'superior' evaluations. > A soma 'holiday' will relieve bad memories and > insure social stabilization.
From: Richard on 8 Apr 2008 01:09
On Apr 5, 3:19 pm, Robert <n...(a)e.mail> wrote: > On Fri, 4 Apr 2008 08:53:49 -0500, "HeyBub" <hey...(a)gmail.com> wrote: > >Robert wrote: > > >> You thought that because 'everyone knows' binary fractions are > >> inaccurate. Some refuse to believe the number is an integer, not a > >> fraction. That was my whole point -- we could have been storing > >> currency amounts (dollars/pounds/zlotnys and cents) in binary all > >> along. We never needed packed decimal. It was an IBM sales gimmick, > >> and it worked. > > >The alternative explanation was that the computer - first used in accounting > >departments - had to exactly reproduce the results obtained by adding > >machines and comptompters in order to be accepted in a commercial > >enviornment. Therefore, IBM invested untold treasure and time to develop > >circuitry to exactly mimic manual methods. > > >But of course that's what you'd expect the Illuminati and the Freemasons to > >say, directed as they are by their alien overlords. > > That sort of ad hominem is what government and big corporations do when caught in a lie to > which they have no rational defense. Members of this august forum have more artful > responses. > > Robert: The sun rises in the east. > > WMK: Have you seen EVERY sunrise since the Earth's creation? No, so you cannot generalize. > > DocD: I barely know what side of the bed *I* get out on, much less anyone else. > > Richard: Arrant nonsense. The azimuth of sunrise is generally toward the equator. We in > the southern hemisphere see the sun rise in the NE or NNE. You Yanks in northern latitudes > see it in the SE. For a particular meaning of 'rise' I have seen the sun rise in the west. Taking off just after sunset and climbing to 30,000 feet brought the sun back up above the horizon. > I long ago put this into a package that when called with a site's > latitude and the date will output the sunrise azimuth accurate to six digits. The original > version was written in Basic for a Sinclair ZX81, Actually I never used any Sinclair machine nor its BASIC. That almost rates as 'ad hominem' to suggest that I did. > where it took several seconds to produce > an answer. As a point of interest, if you are standing within 6 km of either pole, you > will actually see the sun rise in the west .. once per year. > You seem to have a strange idea about what one sees when within the polar areas. [rest of tedious nonsense removed] |