Make floating-point "NaN / 0" return NaN instead of raising an error.
Tom Lane <tgl@sss.pgh.pa.us>
Make floating-point "NaN / 0" return NaN instead of raising an error. This is more consistent with the IEEE 754 spec and our treatment of NaNs elsewhere; in particular, the case has always acted that way in "numeric" arithmetic. Noted by Dean Rasheed. Discussion: https://postgr.es/m/3421746.1594927785@sss.pgh.pa.us
Files
| Path | Change | +/− |
|---|---|---|
| src/include/utils/float.h | modified | +2 −2 |
| src/test/regress/expected/float4-misrounded-input.out | modified | +6 −0 |
| src/test/regress/expected/float4.out | modified | +6 −0 |
| src/test/regress/expected/float8.out | modified | +6 −0 |
| src/test/regress/sql/float4.sql | modified | +1 −0 |
| src/test/regress/sql/float8.sql | modified | +1 −0 |
Discussion
- NaN divided by zero should yield NaN 3 messages · 2020-07-16 → 2020-07-20