Dennis Bjorklund <[EMAIL PROTECTED]> writes: > On Thu, 11 Mar 2004, Neil Conway wrote: >> So, what is the correct behavior: if you multiply two values and get a >> result that exceeds the range of a float8, should you get >> 'Infinity'/'-Infinity', or an overflow error?
> That's the issue and I think we should allow infinity as a result of a > float operation (like you got in the example). It's part of IEEE 754 > math, so not getting Infinity as a result would break that. This would still be infinitely (ahem) better than the behavior you get when an integer operation overflows. We return whatever the hardware gives in such cases. Returning whatever the hardware gives for a float overflow doesn't seem out of line, particularly if it's a well-defined behavior. I am somewhat concerned about the prospect of implementation-dependent results --- machines that do not implement IEEE-style math are going to return something other than an Infinity. However, I think that providing access to the IEEE semantics is more useful than a (rather vain) attempt to impose uniformity across IEEE and non-IEEE machines. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org