Re: BUG #5533: PQexecParams in Binary Mode returns incorrect value for float4

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #5533: PQexecParams in Binary Mode returns incorrect value for float4
Дата
Msg-id 21660.1278003110@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #5533: PQexecParams in Binary Mode returns incorrect value for float4  ("" <myk321@gmail.com>)
Ответы Re: BUG #5533: PQexecParams in Binary Mode returns incorrect value for float4  (Michael Arnold <myk321@gmail.com>)
Список pgsql-bugs
"" <myk321@gmail.com> writes:
> Some needless speculation:
> 0.75 = 3F400000 (as IEEE 32-bit float)
> 0.75 = 3FE8000000000000 (as IEEE 64-bit float)
> 1.812500 = 3FE80000 (as returned by PQexecParams)
> i.e. the return value is the first 32-bits of the 64-bit representation of
> the correct value.

Well, yeah.  You declared the column as float8, not float4:

>     res = PQexec(conn, "CREATE TABLE testtbl( Intgr int4, Flt float8, PRIMARY
KEY ( Intgr ));");

            regards, tom lane

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

Предыдущее
От: ""
Дата:
Сообщение: BUG #5533: PQexecParams in Binary Mode returns incorrect value for float4
Следующее
От: "Mike Fowler"
Дата:
Сообщение: BUG #5534: IS DOCUMENT predicate errors instead of returning false