Search Postgresql Archives

RE: Working with fixed-point calculations in C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, thanks for your answer!  


Yeah, that's correct, I meant NUMERIC and not NUMBER. It was late and I must have accidentally mixed up the names... But thanks for pointing that out! :) But just to clarify, the data type NUMERIC is a fixed point number and not a floating point number?


Alright, so the documentation is just out of date, that's actually what I was hoping for! And while it would be great if it could be updated! Do you in the meantime happen to know where the datatype NUMERIC is defined in the code? And is it the same name in C as in postgres? Or is it something else?


Best Regards 

Oskar


-------- Originalmeddelande --------
Från: Tom Lane <tgl@xxxxxxxxxxxxx>
Datum: 2021-12-08 04:41 (GMT+01:00)
Till: Oskar Stenberg <oskar_stenberg@xxxxxxxxxxx>
Kopia: pgsql-general@xxxxxxxxxxxxxxxxxxxx
Ämne: Re: Working with fixed-point calculations in C

Oskar Stenberg <oskar_stenberg@xxxxxxxxxxx> writes:
> I need to make some fixed-point calculations inside the C code that I'm
> developing as an extension to PostgreSQL. I was reading a bit, and if I
> understood the datatype NUMBER correctly, it seems to be just what I'm
> looking for, a fixed-point datatype. (I couldn't actually find any
> thing in the documentation that specifically mentions that it is a
> fixed point datatype. But it seems to work the same. So I might be
> wrong here and if so please tell me)

I think what you are looking for is NUMERIC.  (The type name NUMBER
is an Oracle-ism, I believe.  I'm not sure how closely that corresponds
to our NUMERIC.)

> Link to the documentation:
> https://www.postgresql.org/docs/current/xfunc-c.html#XFUNC-C-TYPE-TABLE

Hmm, that table seems a bit incomplete/out of date.  While it's
not really meant to cover every type, surely it should mention
bigint, numeric, and timestamptz ...

                        regards, tom lane

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux