I have a query where in, I need to find the exp
of a number. In some cases, the exp
is too huge returning an overflow error or in some cases, the argument for function exp
is too huge. In those cases I need to return some arbitrary value.
Example (which does not work)
select LEAST(exp(1000), 1::double precision);
Here, I attempt to find the exp(1000)
. If it is too huge, I return 1.
How can I do this in Postgres?