I am receiving a value out of range: underflow error from pgsql, in a query that uses the EXP(x) function. What values of x trigger this? How do I prevent or detect it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The function exp is called the exponential function, and its inverse is the natural logarithm, or logarithm to base e. The number e is also commonly defined as the base of the natural logarithm
In other words, exp(x) and e^x are the same function. However, since e is a transcendental number, and therefore irrational, its value cannot be given exactly.
The Numerical value of e truncated to 10 decimal places is 2.71828 1828
So, the function exp(x) is technically valid for all values of x, but practically speaking, you can limit them. For example, if you limit them to +/- 700 you should cover all cases covering the range
More than that depends on your application