From -7025312961410109298
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,7b33df5790e7ad92
X-Google-Attributes: gidf78e5,public
From: Gabriel Dos_Reis <gdosreis@korrigan.inria.fr>
Subject: Re: complex design flaw (#1)
Date: 1999/03/15
Message-ID: <xajzp5f5rw0.fsf@korrigan.inria.fr>#1/1
X-Deja-AN: 455095825
X-NNTP-Posting-Host: korrigan.inria.fr
Content-Transfer-Encoding: 8bit
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <x88pv6fok3r.fsf@nbeckerpc.hns.com> <xaj3e3be4pu.fsf@korrigan.inria.fr> <01be6e30$aeae59e0$7d9cd4c7@danielp.interlog.com>
X-UID: 0000000001
X-Status: $$$T
Content-Type: text/plain; charset=iso-8859-1
Organization: I.N.R.I.A Sophia-Antipolis (France)
Mime-Version: 1.0
Newsgroups: comp.std.c++
Originator: clamage@taumet


"Daniel Parker" <danielp@no_spam.com> writes:

| Gabriel Dos_Reis <gdosreis@korrigan.inria.fr> wrote in article
| <xaj3e3be4pu.fsf@korrigan.inria.fr>...
| > 
| > nbecker@fred.net writes:
| > 
| > So initialiation of a vector or
| > a valarray of complex<double> may be result in a memset().
| 
| Incidently, I'm a little rusty on the bit layout of a floating point
| number; can I rely on
| 
| double x = 0.0;
| double y;
| 
| memset( &y, 0, sizeof(double) );
| 
| x == y ?

On most plateforms and with serious C++ implementations (for example those
that adhere to IEEE-754), the answer is unambiguously *yes*.
IEEE-754 and LIA-1 require (-0 == +0) to evaluate to true.

| memcmp( &x, &y, sizeof(double) ) == 0 ?

yes (again under the previous assumptions).

-- 
Gabriel Dos Reis, dosreis@cmla.ens-cachan.fr


[ 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://reality.sgi.com/austern_mti/std-c++/faq.html              ]




