Article View: comp.lang.misc
Article #676Re: Fast conversions, another urban myth?
From: George Gerrity
Date: Wed, 11 Oct 1989 06:23
Date: Wed, 11 Oct 1989 06:23
37 lines
2543 bytes
2543 bytes
Scott Amspoker comments " ... I have to deal with decimal formats
everyday and I haven't been near a COBOL compiler in 12 years ..."
Two points 1) perhaps Scott is confusing FORMATS with REPRESENTATION,
as the semantics of COBOL does. That was my point -- the internal repre-
sentation is irrelevant unless format and representation are for some
reason coupled by the semantics of the language. Moreover, you can get
around the problem by careful programming in COBOL. 2) Scott also points
out that there are lots of other languages using (requiring?) floating
decimal representations. I guess so, but if COBOL (mis)usage didn't gen-
erate a (spurious) need for hardware decimal arithmetic, then those other
languages would also learn to do without.
Michael Meissner comments that COBOL uses overlayed structures, simi-
lar to Pascal variant records, with the implication that it somehow im-
pacts on my argument. It does not. Overlays don't necessarily imply
data conversion. I suspect that if they do, then it is an abuse of the
feature. All it means is that stored overlayed fields require as much
space as the biggest overlayed field.
Andrew Klossner gives a contrived (his words) example of a case where
decimal arithmetic is (supposedly) faster than binary. If his RISC mach-
ine doesn't have binary divide, then it is unlikely to have BCD instruc-
tions either. Moreover, a smart compiler dealing with the scaling prob-
lem will delay division as late as possible, ie, until it needs to output
a datum, and will keep the internal formats in their scaled form. Event-
ually, of course, the division will have to be done.
George
----
Dr. G. W. Gerrity Phone: +61 62 68 8180
Dept. of Computer Science Fax: +61 62 68 8581
University College, UNSW Email: gwg@cs.adfa.oz.au
ADFA, Northcott Drive Telex: ADFADM AA62030
Canberra, ACT 2600
AUSTRALIA
Technical Details
Message-ID:
<2268@csadfa.oz>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!uwm.edu!uakari.primate.wisc.edu!ginosko!uunet!munnari.oz.au!csc!ccadfa!csadfa!gwgReferences:
<832@dms.UUCP> <688@UALTAVM.BITNET> <208@bbxsda.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!uwm.edu!uakari.primate.wisc.edu!ginosko!uunet!munnari.oz.au!csc!ccadfa!csadfa!gwg From: gwg@csadfa.oz (George Gerrity) Newsgroups: comp.lang.misc,comp.arch Subject: Re: Fast conversions, another urban myth? Message-ID: <2268@csadfa.oz> Date: 11 Oct 89 06:23:36 GMT References: <832@dms.UUCP> <688@UALTAVM.BITNET> <208@bbxsda.UUCP> Organization: Dept. of Computer Science, University College, UNSW, ADFA, Canberra, Australia Lines: 37