public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alasdair Baird <alasdair@wildcat.demon.co.uk>
To: Erik Mouw <J.A.K.Mouw@its.tudelft.nl>
Cc: 97nv46@skola.kiruna.se, gcc@gcc.gnu.org
Subject: Re: Volatile constants?
Date: Wed, 29 Mar 2000 09:53:00 -0000	[thread overview]
Message-ID: <14562.16912.888978.578471@wildcat.demon.co.uk> (raw)
In-Reply-To: <200003291530.RAA06981@duteinh.et.tudelft.nl>

 > > #define abs2(x) (x<0 ? -x : x)
 > 
 > <nitpick>
 > You should define this as:
 > 
 >   #define abs2(x) ((x) < 0 ? (-x) : (x))
 > 
 > Rationale: see what happens with your version if you use abs2(2 - 3). The
 > extra parentesis enforce the correct operator precedence.

I think that you might find the following to actually be correct though:

   #define abs2(x) ((x) < 0 ? -(x) : (x))

  reply	other threads:[~2000-03-29  9:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-29  4:57 Christian Häggström
2000-03-29  7:41 ` Erik Mouw
2000-03-29  9:53   ` Alasdair Baird [this message]
2000-03-29 10:05     ` Erik Mouw
2000-03-29  7:45 ` Kevin Handy
2000-03-29 12:18   ` Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2000-04-03  2:33 Christian Häggström
     [not found] <s8e49edd.056@ymer>
2000-03-31  3:17 ` Richard Earnshaw
2000-03-31  2:50 Christian Häggström
2000-03-29 23:31 Christian Häggström
2000-03-30  4:21 ` Richard Earnshaw
2000-02-22  0:52 Christian Häggström

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=14562.16912.888978.578471@wildcat.demon.co.uk \
    --to=alasdair@wildcat.demon.co.uk \
    --cc=97nv46@skola.kiruna.se \
    --cc=J.A.K.Mouw@its.tudelft.nl \
    --cc=gcc@gcc.gnu.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).