From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: erik quanstrom Date: Thu, 22 Jan 2009 16:40:17 -0500 To: 9fans@9fans.net In-Reply-To: <13426df10901221253le795d82w6eb4bbf5e5e00be8@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] fun question Topicbox-Message-UUID: 84cb48da-ead4-11e9-9d60-3106f5b1d025 On Thu Jan 22 15:55:09 EST 2009, rminnich@gmail.com wrote: > I ask this every time I hit this piece of code, I think. But what the heck: > > if(seed <- 0) > seed = seed + m_31; > > what's wrong with this code? supposing the code does what it is supposed to on some machines, i would guess that this could be a problem for sign-magnitude or one's-comp. machines, since 0 and -0 are different. if that's the case, one would guess that the object is to clear sign bit and -0 is the failure case. then again, that's a very wild guess and one would assume that sign = -sign would be better. -0 is a strange construction and the spacing is misleading. it's interesting that atoi(2) and the differ on "- 0". - erik