pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Darafei "Komяpa" Praliaskouski <me@komzpa.net>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Subject: Re: exp() versus the POSIX standard
Date: Thu, 11 Jun 2020 21:25:41 -0400
Message-ID: <607042.1591925141@sss.pgh.pa.us> (raw)
In-Reply-To: <CAC8Q8tJ09umiQdpGpGqiYRb8JOmnLztD2rQNk+o5FOx0cFBvQw@mail.gmail.com>
References: <582552.1591917752@sss.pgh.pa.us>
	<583847.1591919809@sss.pgh.pa.us>
	<CAC8Q8tJ09umiQdpGpGqiYRb8JOmnLztD2rQNk+o5FOx0cFBvQw@mail.gmail.com>

=?UTF-8?Q?Darafei_=22Kom=D1=8Fpa=22_Praliaskouski?= <me@komzpa.net> writes:
> I've had the same issue with multiplying two tiny numbers. Select
> 2e-300::float * 2e-300::float gives an underflow, and it is not a wanted
> thing. This looks like handmade implementation of IEEE754's underflow
> exception that should be an optional return flag in addition to well
> defined number, but became a stop-the-world exception instead.

Solving that problem is very far outside the scope of what I'm interested
in here.  I think that we'd probably regret it if we try to support IEEE
subnormals, for example --- I know that all modern hardware is probably
good with those, but I'd bet against different platforms' libc functions
all behaving the same.  I don't see a sane way to offer user control over
whether we throw underflow errors or not, either.  (Do you really want "+"
to stop being immutable?)  The darker corners of IEEE754, like inexactness
exceptions, are even less likely to be implemented consistently
everywhere.

			regards, tom lane





view thread (8+ messages)  latest in thread

Message-ID: <607042.1591925141@sss.pgh.pa.us>
Permalink:  ../607042.1591925141@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/607042.1591925141@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, me@komzpa.net, pgsql-hackers@lists.postgresql.org
  Subject: Re: exp() versus the POSIX standard
  In-Reply-To: <607042.1591925141@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox