Re: Absolute value of intervals - Mailing list pgsql-general

From Sam Mason
Subject Re: Absolute value of intervals
Date
Msg-id 20091027152942.GM5407@samason.me.uk
Whole thread Raw
In response to Re: Absolute value of intervals  (Sam Mason <sam@samason.me.uk>)
List pgsql-general
On Tue, Oct 27, 2009 at 03:25:02PM +0000, Sam Mason wrote:
> If the absolute value of an interval was defined to strip out all the
> negation signs you'd get the "wrong" answers out.

Oops, forgot another reason!  For maths to work (n) and (-(-n)) should
evaluate to the same value.  Inverting all the signs, as negation does,
will ensure that these semantics remain.

--
  Sam  http://samason.me.uk/

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: Absolute value of intervals
Next
From: Scott Bailey
Date:
Subject: Re: Absolute value of intervals