Q67353: Math Functions in LLIBCDLL May Not Return Zero on Domain Error
Article: Q67353
Product(s): See article
Version(s): 6.00 6.00a
Operating System(s): OS/2
Keyword(s): ENDUSER | buglist6.00 buglist6.00a | mspl13_c
Last Modified: 4-DEC-1990
The C run-time math routines in the statically-linked DLL library
(LLIBCDLL.LIB) that are designed to return zero when they encounter a
domain error may not return zero. Domain errors are detected correctly
but the return values are incorrect in these instances because they
should be zero.
For example, calling the sqrt() function with an argument of -1 should
cause a DOMAIN error and cause the return value to be zero. The
LLIBCDLL version of sqrt() does set errno to EDOM (domain error) in
this case, but the return value from the function is non-zero. The
sqrt() function in the standard library xLIBCEP.LIB, the multithreaded
library LLIBCMT.LIB, and the version that goes into a C run-time DLL
all correctly return zero.
Microsoft has confirmed this to be a problem in C versions 6.00 and
6.00a. We are researching this problem and will post new information
here as it becomes available.
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
Copyright Microsoft Corporation 1986-2002.