9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] fun question
Date: Thu, 22 Jan 2009 16:40:17 -0500	[thread overview]
Message-ID: <d776c13a0a98c66024205920d0c663dc@quanstro.net> (raw)
In-Reply-To: <13426df10901221253le795d82w6eb4bbf5e5e00be8@mail.gmail.com>

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



  reply	other threads:[~2009-01-22 21:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22 20:53 ron minnich
2009-01-22 21:40 ` erik quanstrom [this message]
2009-01-22 22:01 ` Russ Cox
2009-01-22 22:12   ` Pietro Gagliardi
2009-01-22 22:54     ` Russ Cox
2009-01-22 23:01       ` erik quanstrom
2009-01-22 23:17         ` ron minnich
2009-01-23  0:46         ` Pietro Gagliardi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d776c13a0a98c66024205920d0c663dc@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).