Re: Remove dependence on integer wrapping - Mailing list pgsql-hackers

From Joseph Koshakow
Subject Re: Remove dependence on integer wrapping
Date
Msg-id CAAvxfHdYnTB7BjkRSPO8__wxB3880TiYD-TVU2uW8q1KbzymPg@mail.gmail.com
Whole thread Raw
In response to Re: Remove dependence on integer wrapping  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: Remove dependence on integer wrapping
List pgsql-hackers
Thanks for the review!

On Mon, Jul 15, 2024 at 11:31 AM Nathan Bossart <nathandbossart@gmail.com> wrote:
>
>    I took a closer look at 0002.
>
>    I'm curious why you aren't using float8_mul/float8_div here, i.e.,
>
>            fresult = rint(float8_mul((float8) c, f));
>            fresult = rint(float8_div((float8) c, f));

I wrongly assumed that it was only meant to be used to implement
multiplication and division for the built-in float types. I've updated
the patch to use these functions.

>    nitpick: I'd name the functions something like "cash_mul_float8" and
>    "cash_div_float8". Perhaps we could also add functions like
>    "cash_mul_int64"

Done in the updated patch.

>    and "cash_sub_int64"

Did you mean "cash_div_int64"? There's only a single function that
subtracts cash and an integer, but there's multiple functions that
divide cash by an integer. I've added a "cash_div_int64" in the updated
patch.

The other patches, 0001, 0003, and 0004 are unchanged but have their
version number incremented.

Thanks,
Joe Koshakow
Attachment

pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Addressing SECURITY DEFINER Function Vulnerabilities in PostgreSQL Extensions
Next
From: Jacob Champion
Date:
Subject: Re: Proposal for implementing OCSP Stapling in PostgreSQL