Re: Floating point type to store numbers

Поиск
Список
Период
Сортировка
От Radhika Sambamurti
Тема Re: Floating point type to store numbers
Дата
Msg-id 19167.63.118.86.10.1176841684.squirrel@www.88thstreet.com
обсуждение исходный текст
Ответ на Re: Floating point type to store numbers  (Richard Broersma Jr <rabroersma@yahoo.com>)
Список pgsql-sql
>
> ---
>> The question is: how accurate is floating point numbers in Postgres. We
>> are using 7.4 soon to be moving to 8.2.
>> I need the accuracy to about 6 decimal points. I have read that floating
>> points can convert to numbers in accurately.
>
> http://www.postgresql.org/docs/8.2/interactive/datatype-numeric.html#DATATYPE-FLOAT
>
> I didn't see anything about numeric being a string type,
>
>

Numeric values are physically stored without any extra leading or trailing
zeroes. Thus, the declared precision and scale of a column are maximums,
not fixed allocations. (In this sense the numeric type is more akin to
varchar(n) than to char(n).) The actual storage requirement is two bytes
for each group of four decimal digits, plus eight bytes overhead.

However, arithmetic on numeric values is very slow compared to the integer
types, or to the floating-point types described in the next section.

http://www.postgresql.org/docs/8.2/static/datatype-numeric.html

http://www.postgresql.org/docs/8.2/interactive/datatype-numeric.html#DATATYPE-NUMERIC-DECIMAL
>
> Regards,
> Richard Broersma Jr.
>


-- 
It is all a matter of perspective. You choose your view by choosing where
to stand.
Larry Wall
---

-- 
It is all a matter of perspective. You choose your view by choosing where
to stand.
Larry Wall
---



В списке pgsql-sql по дате отправления:

Предыдущее
От: Richard Broersma Jr
Дата:
Сообщение: Re: Floating point type to store numbers
Следующее
От: "Radhika Sambamurti"
Дата:
Сообщение: Re: Floating point type to store numbers