Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: Python Front-end to GCC Date: Fri, 25 Oct 2013 19:06:27 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 37 Message-ID: References: <4012031f-5334-4be8-a673-e0d8c8917fb2@googlegroups.com> <5264dbbe$0$30000$c3e8da3$5496439d@news.astraweb.com> <5265bba8$0$29981$c3e8da3$5496439d@news.astraweb.com> <526668e5$0$29981$c3e8da3$5496439d@news.astraweb.com> <52669852$0$29981$c3e8da3$5496439d@news.astraweb.com> <5266aa80$0$29981$c3e8da3$5496439d@news.astraweb.com> <5266b496$0$29981$c3e8da3$5496439d@news.astraweb.com> <526A81A4.4040100@nedbatchelder.com> NNTP-Posting-Host: dsl.comtrol.com X-Trace: reader1.panix.com 1382727987 10186 64.122.56.22 (25 Oct 2013 19:06:27 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Fri, 25 Oct 2013 19:06:27 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:57548 On 2013-10-25, Mark Janssen wrote: >>>>> OTOH why in particular would you want to initialise them with zeros? I >>>>> often initialise arrays to nan which is useful for debugging. >>> >>> Is this some kind of joke? What has this list become? >> >> It's a useful debugging technique to initialize memory to distinctive >> values that should never occur in real data. > > If you're doing this, you're doing something wrong. Pardon me if I don't take your word for it. > Please give me the hex value for NaN so I can initialize with my > array. Seriously? You haven't discovered google and wikepedia yet? http://www.google.com/ http://en.wikipedia.org/ Assuming you're using IEEE-754, all 1's is a quiet NaN: http://en.wikipedia.org/wiki/IEEE_floating_point http://en.wikipedia.org/wiki/NaN If you want a signaling NaN you've got to change one of the bits (see the above links). IIRC, the Pascal language required that using unintialized variables caused an error. intializing FP values to a signalling NaN is a very convenient way to do that. -- Grant Edwards grant.b.edwards Yow! I'm also against at BODY-SURFING!! gmail.com