9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: tlaronde@polynum.com
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Rounding off by one
Date: Mon, 19 Apr 2010 21:28:01 +0200	[thread overview]
Message-ID: <20100419192801.GA4698@polynum.com> (raw)
In-Reply-To: <362242f5ceb5800384e56ddf3135023f@ladd.quanstro.net>

On Mon, Apr 19, 2010 at 03:03:19PM -0400, erik quanstrom wrote:
> On Mon Apr 19 14:57:02 EDT 2010, benavento@gmail.com wrote:
> > check getfcr(2)
> >
> >  http://plan9.bell-labs.com/magic/man2html?man=getfcr&sect=2
> >
> > it's in lib9.h for ape
>
> this doesn't apply to the integer calcuations in question.

Nonetheless, thanks for the tips, guys! but I think I have found:

-7 / 2		yields -3

(symetric of 7 / 2, but no guarante from C for negatives) while:

-7 >> 1		yields -4

(floor, what is wanted by METAFONT).

Uh!
--
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                      http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C



      parent reply	other threads:[~2010-04-19 19:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-19 15:43 tlaronde
2010-04-19 16:11 ` Martin Neubauer
2010-04-19 18:15   ` tlaronde
2010-04-19 18:26     ` tlaronde
2010-04-19 18:55 ` Federico G. Benavento
2010-04-19 19:03   ` erik quanstrom
2010-04-19 19:14     ` Federico G. Benavento
2010-04-19 19:28     ` tlaronde [this message]

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=20100419192801.GA4698@polynum.com \
    --to=tlaronde@polynum.com \
    --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).