Floating point exceptions.

Поиск
Список
Период
Сортировка
От Keith Parks
Тема Floating point exceptions.
Дата
Msg-id 199801071611.QAA27856@mtcc.demon.co.uk
обсуждение исходный текст
Список pgsql-hackers
Hi All,

I suspect this is an O/S or platform problem but can anyone offer any
suggestions as to how I might locate the cause.

DROP TABLE  FLOAT8_TBL;
DROP

CREATE TABLE FLOAT8_TBL(f1 float8);
CREATE

INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
INSERT 277993 1

SELECT '' AS bad, : (f.f1) from FLOAT8_TBL f;
ABORT:  floating point exception! The last floating point operation either
exceeded legal ranges or was a divide by zero


The ABORT message comes from tcop.c when we are hit by a FPE signal by
the operating system.

.....

Here's some additional tests that seem to show the threshold.

postgres=> CREATE TABLE FLOAT8_TBL(f1 float8);
CREATE
postgres=> INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-150');
INSERT 278057 1
postgres=>  SELECT '' AS bad, : (f.f1) from FLOAT8_TBL f;
bad|?column?
---+--------
   |       1
(1 row)

postgres=> INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-151');
INSERT 278058 1
postgres=> SELECT '' AS bad, : (f.f1) from FLOAT8_TBL f;
ABORT:  floating point exception! The last floating point operation either
exceeded legal ranges or was a divide by zero

Keith.


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

Предыдущее
От: darrenk@insightdist.com (Darren King)
Дата:
Сообщение: Linux/Alpha's s_lock.c and other ports...
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] database size