From -4385534897396802093
X-Google-Thread: f78e5,e2cfdf64f67c7793
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news1.google.com!news.glorb.com!news.zanker.org!news.clara.net!wagner.news.clara.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: walter@digitalmars.nospamm.com ("Walter")
Newsgroups: comp.std.c++
Subject: Re: Eliminating uninitialised variables
Date: Thu, 23 Sep 2004 06:18:59 GMT
Organization: Comcast Online
Lines: 26
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <aRm4d.348315$8_6.249357@attbi_s04>
References: <4150695d@andromeda.datanet.hu> <memo.20040922200512.2520C@brangdon.m>
NNTP-Posting-Host: news.news.demon.net
X-Trace: news.demon.co.uk 1095920343 24037 158.152.254.254 (23 Sep 2004 06:19:03 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Thu, 23 Sep 2004 06:19:03 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Priority: 3
X-Spam-Checker-Version: SpamAssassin 2.64-mulga_r1 (2004-01-11) on 
	mulga.cs.mu.OZ.AU
X-Spam-Status: No, hits=-3.4 required=5.0 tests=AWL,BAYES_00,PRIORITY_NO_NAME 
	autolearn=no version=2.64-mulga_r1
X-MSMail-Priority: Normal
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id i8N6IxDb021794;
	Thu, 23 Sep 2004 16:18:59 +1000 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-NNTP-Posting-Date: Wed, 22 Sep 2004 22:16:38 GMT
X-Spam-Level: 
X-Delivered-To: std-c++@ucar.edu
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-Newsgroups: comp.std.c++
Xref: g2news1.google.com comp.std.c++:2851


"Dave Harris" <brangdon@cix.co.uk> wrote in message
news:memo.20040922200512.2520C@brangdon.m...
> I'm pretty sure IEEE allows all bits 0 for 0.0, but whatever.

It does. All bits 0 is +0.0 for IEEE 754 floating point encodings.

D, however, default initializes floating point values to the NaN bit
pattern, not 0. This has bug finding advantages because it causes the
programmer to have to think about what value it should be initialized to,
rather than inadvertantly using 0.0 which may become a hidden bug.

It's too bad there is no NaN pattern for integer types. Even better would be
a memory bit per location that could be set to "uninitialized" which would
cause a trap if that location was read. I wonder some times how many latent
bugs of this nature are in shipping applications <g>.

-Walter
www.digitalmars.com free C/C++/D compilers

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



