Thread: cash_mul_int8 / cash_div_int8

cash_mul_int8 / cash_div_int8

From
Kohei KaiGai
Date:
I noticed cash_mul_int8 / cash_div_int8 are defined in cash.c,
however, pg_proc.h and pg_operator.h contains no relevant entries.

Is it just a careless oversight?

Thanks,
-- 
KaiGai Kohei <kaigai@kaigai.gr.jp>



Re: cash_mul_int8 / cash_div_int8

From
Tom Lane
Date:
Kohei KaiGai <kaigai@kaigai.gr.jp> writes:
> I noticed cash_mul_int8 / cash_div_int8 are defined in cash.c,
> however, pg_proc.h and pg_operator.h contains no relevant entries.

> Is it just a careless oversight?

Hm.  I'd be inclined to fix that by removing the dead code, since
it's evidently useless.  For that matter, I doubt we need the int2
and flt4 variants; might as well depend on automatic promotions.
        regards, tom lane



Re: cash_mul_int8 / cash_div_int8

From
Kohei KaiGai
Date:
Also, cash_pl, cash_mi, cash_mul_int4 and so on... does not have overflow checks
like as int8pl has.

Of course, most of people don't need to worry about 64bit overflow for
money... :-).

2015-10-08 0:03 GMT+09:00 Kohei KaiGai <kaigai@kaigai.gr.jp>:
> I noticed cash_mul_int8 / cash_div_int8 are defined in cash.c,
> however, pg_proc.h and pg_operator.h contains no relevant entries.
>
> Is it just a careless oversight?
>
> Thanks,
> --
> KaiGai Kohei <kaigai@kaigai.gr.jp>



-- 
KaiGai Kohei <kaigai@kaigai.gr.jp>



Re: cash_mul_int8 / cash_div_int8

From
Michael Paquier
Date:
On Thu, Oct 8, 2015 at 12:11 AM, Kohei KaiGai <kaigai@kaigai.gr.jp> wrote:
> Also, cash_pl, cash_mi, cash_mul_int4 and so on... does not have overflow checks
> like as int8pl has.
>
> Of course, most of people don't need to worry about 64bit overflow for
> money... :-).

If you are using Zimbabwean dollar that's an issue:
https://en.wikipedia.org/wiki/Zimbabwean_dollar#Hyperinflation
-- 
Michael