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 X-Google-Thread: 103376,5f764f1f7822ab9c X-Google-Attributes: gid103376,public From: Bill Brennan Subject: Re: Top 10 Language Constructs (Ada) Date: 2000/07/19 Message-ID: <39754435.F4DEA73B@lmco.com>#1/1 X-Deja-AN: 647877609 Content-Transfer-Encoding: 8bit References: <8kmjja$l5h$1@pollux.ip-plus.net> <3970F56F.F3A70FAD@icdc.com> <01HW.B59982450058903A078EC70C@news.pacbell.net> <39751555.4E40A4A7@lmco.com> <8l21od$mkr@newsserv.vs.dasa.de> X-Accept-Language: en Content-Type: text/plain; charset=iso-8859-1 X-Complaints-To: usenet@news.vf.lmco.com X-Trace: knight.vf.lmco.com 963943173 23650 166.17.160.226 (18 Jul 2000 17:59:33 GMT) Organization: Lockheed Martin Mime-Version: 1.0 NNTP-Posting-Date: 18 Jul 2000 17:59:33 GMT Newsgroups: comp.lang.ada Date: 2000-07-18T17:59:33+00:00 List-Id: "Dr. Joachim Schr�er" wrote: > > Bill Brennan schrieb in im Newsbeitrag: > > type Plasma_Volts_Type is > > delta 2#000.0_0000_0000_0001# -- approx 0.00012207 > > range -2#100.0_0000_0000_0000# .. -- -4 > > 2#011.1_1111_1111_1111#; -- approx 3.99987793 > > > > for Plasma_Volts_Type'Size use 16; > > > > What about this version: > > type Plasma_Volts_Type is delta 2.0**(-13) range -4.0 .. 4.0 - 2.0**(-13); > for Plasma_Volts_Type'Size use 16; While your version is more concise and arguably easier to read (all right, it *is* easier to read ;-)), I chose my representation, long-winded as it is, to demonstrate that the 'First and 'Last were chosen to be the most extreme values in the possible range of this 16-bit representation. In fact, I had to prove this to myself on paper first, by mapping out the bits, and just decided to transfer my notes to Ada. If this information isn't particularly useful to demonstrate in the code, then the concise version wins for sure. Isn't it nice that we have the choice, and that both options convey the information with slightly differing emphasies? (Are there other interesting representations?) -- Bill Brennan