From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: get rid of Abs()
Date: Tue, 04 Oct 2022 09:29:36 -0400
Message-ID: <1819349.1664890176@sss.pgh.pa.us> (raw)
In-Reply-To: <4beb42b5-216b-bce8-d452-d924d5794c63@enterprisedb.com>
References: <4beb42b5-216b-bce8-d452-d924d5794c63@enterprisedb.com>
Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
> I was wondering why we have a definition of Abs() in c.h when there are
> more standard functions such as abs() and fabs() in widespread use. I
> think this one is left over from pre-ANSI-C days. The attached patches
> replace all uses of Abs() with more standard functions.
I'm not in favor of the llabs() changes. I think what we really want
in those places, or at least most of them, is "abs() for int64".
That could be had by #define'ing "iabs64" (or some name along that
line) as labs or llabs depending on which type we are using for int64.
Seems OK beyond that nitpick.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, peter.eisentraut@enterprisedb.com
Subject: Re: get rid of Abs()
In-Reply-To: <1819349.1664890176@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox