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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c4cb2c432feebd9d X-Google-Thread: 1094ba,c4cb2c432feebd9d X-Google-Thread: 101deb,15c6ed4b761968e6 X-Google-Attributes: gid103376,gid1094ba,gid101deb,public X-Google-Language: ENGLISH,CP1252 Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!bcklog1.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 09 Jul 2006 18:43:28 -0500 Date: Sun, 09 Jul 2006 16:44:02 -0700 From: glen herrmannsfeldt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada,comp.lang.fortran,comp.lang.pl1 Subject: Re: Ada vs Fortran for scientific applications References: <0ugu4e.4i7.ln@hunter.axlog.fr> <%P_cg.155733$eR6.26337@bgtnsc04-news.ops.worldnet.att.net> <6H9dg.10258$S7.9150@news-server.bigpond.net.au> <1hfv5wb.1x4ab1tbdzk7eN%nospam@see.signature> <2006052509454116807-gsande@worldnetattnet> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <0KednTbQvuA9CSzZnZ2dnUVZ_oGdnZ2d@comcast.com> NNTP-Posting-Host: 24.18.174.4 X-Trace: sv3-5Sqlodo8qEUR9jwtEswbIZvnDh5Sb7p+Q0lQ/Q7emKXI2viT7F6pV7T233c2u23ryP1yRu6BMyRIthi!vY9SuxSPVEzF0xaYKuE/zN0HL9Oi92B2GdwPYwFtl/JfTBQgWf+8nzPin61npeROGoKoCjefIaTY!nlhqyQ== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:5588 comp.lang.fortran:11864 comp.lang.pl1:1964 Date: 2006-07-09T16:44:02-07:00 List-Id: (snip, someone wrote) >>That's not entirely true, the standard states Integer must include the >>range �2**15+1 .. +2**15�1 - thus (usually) leaving -2**15 as a >>possible 'default uninitialized' value. James Giles wrote: > Well I allowed for that possibility. I made no absolute > assertion. I said "most Ada implementations". In fact, > most language definitions *allow* implementations > to implement integers with a lot of flexibility. C pretty much requires binary for unsigned integers, but is more general for signed integers. C does allow "padding bits", that is, bits not used as value bits. Java requires twos complement binary with specific bit widths. Otherwise, most allow for other bases and representations. > Most > actual implementations use all the bit patterns their > underlying hardware allows and *don't* use any of > them for NOI (Not An Integer). There might be some hardware that can detect negative zero, or other unused representations. That is rare. > And, let's not forget > character data types (does your actual implementation > have a value that means NOC - Not A Character?). The only one I used with specific detection for undefined values is WATFIV which uses all bytes equal to X'81', even for CHARACTER*1 where it is 'a'. > What about booleans? Ada also has fixed point types, > enumerations, records, etc. Does your actual implementation > catch uses of undefined variables for all those? Indeed, > does it even use NANs from the floating point hardware to > detect uninitialized REALs? > It's true: nearly all languages permit implementations > to internally represent data with additional memory > for the purpose of detecting and reporting uses of > undefined variables (and for other reasons - like the > value of a variable that was defined, but the expression > involved an unhandled exception). Well, C allows it for any purpose or even no purpose at all. > In formal semantics, > the idea is called a lifted domain. Applying it in software > is expensive at run-time. > Now, I've always liked the idea of using the anomalous > value in two's complement integers (sign bit set, all others > clear) as NOI. I don't think it's a likely implementation > strategy unless it was treated that way in hardware. There might be some that will detect it for other than twos complement, but I don't know any hardware that does for twos complement. -- glen