Article ID: 285544 - Last Review: October 16, 2003 - Revision: 3.2 FIX: Dividing 0 by a Negative Decimal or Numeric Number Results in -0This article was previously published under Q285544
BUG #: 203148 (SHILOH_bugs)
SYMPTOMS
When using decimal or numeric data types, if you divide 0 by a negative number, a negative 0 (-0) is returned.
RESOLUTIONTo resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in the
Microsoft Knowledge Base:
290211
(http://support.microsoft.com/kb/290211/EN-US/
)
INF: How to Obtain the Latest SQL Server 2000 Service Pack
WORKAROUND
Check for 0 before you perform the division and avoid the division if 0 is involved; for example:
STATUSMicrosoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1. MORE INFORMATION
SQL Server does not consider the computed value (-0) equal to 0, so
the comparison of the computed value (-0) with 0 fails. For example, the following code
275608
(http://support.microsoft.com/kb/275608/EN-US/
)
FIX: Mathematical Operations on Numeric or Decimal Columns with Negative Numbers May Return Unexpected Results
| Article Translations
|
Back to the top
