Re: Exponential notation bug

From: Maciek Sakrejda <maciek(at)pganalyze(dot)com>
To: Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Exponential notation bug
Date: 2025-04-04 16:12:54
Message-ID: CADXhmgTnGDTMBi-d5R3Ew0jfZ1UNPdshuvmJkwL1NxqvUahJZg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I took a look at simplifying this test case, and I think it comes down
to data types:

maciek=# select 9/10;
?column?
----------
0
(1 row)

maciek=# select pg_typeof(10);
pg_typeof
-----------
integer
(1 row)

But:

maciek=# select 9/1e1;
?column?
------------------------
0.90000000000000000000
(1 row)

maciek=# select pg_typeof(1e1);
pg_typeof
-----------
numeric
(1 row)

Does that explain the behavior you're seeing?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-04-04 16:14:08 Re: Exponential notation bug
Previous Message Melanie Plageman 2025-04-04 16:10:41 Re: New criteria for autovacuum