msvcrt: Don't set errno in sqrt(f) if x is positive infinity.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2017-08-01 00:13:35 -06:00 committed by Alexandre Julliard
parent 57cdf8bfa8
commit d20b89cf93
1 changed files with 2 additions and 2 deletions

View File

@ -279,7 +279,7 @@ float CDECL MSVCRT_sinhf( float x )
*/
float CDECL MSVCRT_sqrtf( float x )
{
if (x < 0.0 || !finitef(x)) *MSVCRT__errno() = MSVCRT_EDOM;
if (x < 0.0) *MSVCRT__errno() = MSVCRT_EDOM;
return sqrtf(x);
}
@ -476,7 +476,7 @@ double CDECL MSVCRT_sinh( double x )
*/
double CDECL MSVCRT_sqrt( double x )
{
if (x < 0.0 || !isfinite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
if (x < 0.0) *MSVCRT__errno() = MSVCRT_EDOM;
return sqrt(x);
}