Avoiding in underflow in double -> real conversions

From: David Wilson <david(dot)t(dot)wilson(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Avoiding in underflow in double -> real conversions
Date: 2010-09-24 17:50:31
Message-ID: AANLkTimAyMgvd-QGYg1mD3dk5qA+WsNGLdbyxwkyZits@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

List-

I've got a calculation that, due to its use of exp(), is produces double
precision intermediate results which I ultimately need to cast back to real
to store in a table column. However, with certain inputs, this results in an
underflow error. Is there any way outside of an exception-trapping plpgsql
function to performance the conversion and simply cause underflows to result
in a 0?

Thanks for any ideas.

--
- David T. Wilson
david(dot)t(dot)wilson(at)gmail(dot)com

Browse pgsql-general by date

  From Date Subject
Next Message Lincoln Yeoh 2010-09-24 18:04:26 Re: Trade Study on Oracle vs. PostgreSQL
Previous Message Leif Biberg Kristensen 2010-09-24 17:42:47 Re: Front End Application (OFF-TOPIC)