Re: [PATCH] src\backend\utils\adt\numeric.c copy and past error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] src\backend\utils\adt\numeric.c copy and past error
Date: 2020-01-20 00:46:18
Message-ID: 28174.1579481178@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> writes:
> Yes, but the comment it does not clarify that the return of the variable
> "const_one" is intentional, instead of "const_zero".

I'm not sure which part of "NaN ^ 0 = 1" doesn't clarify for you that
the intended result is 1.

Even without the comment, if you'd bothered to run the regression tests
you'd have noted a failure of a test case clearly intended to test
exactly this behavior.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message tsunakawa.takay@fujitsu.com 2020-01-20 01:04:33 RE: SLRU statistics
Previous Message Tom Lane 2020-01-20 00:38:13 Re: range_agg