Commit a3035679 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Improved _atoflt_l precision.

parent ffd5e3eb
...@@ -983,6 +983,7 @@ int pf_printf_w(puts_clbk_w, void*, const MSVCRT_wchar_t*, MSVCRT__locale_t, ...@@ -983,6 +983,7 @@ int pf_printf_w(puts_clbk_w, void*, const MSVCRT_wchar_t*, MSVCRT__locale_t,
BOOL, BOOL, args_clbk, void*, __ms_va_list*) DECLSPEC_HIDDEN; BOOL, BOOL, args_clbk, void*, __ms_va_list*) DECLSPEC_HIDDEN;
printf_arg arg_clbk_valist(void*, int, int, __ms_va_list*) DECLSPEC_HIDDEN; printf_arg arg_clbk_valist(void*, int, int, __ms_va_list*) DECLSPEC_HIDDEN;
#define MSVCRT_FLT_MIN 1.175494351e-38F
#define MSVCRT__OVERFLOW 3 #define MSVCRT__OVERFLOW 3
#define MSVCRT__UNDERFLOW 4 #define MSVCRT__UNDERFLOW 4
......
...@@ -514,13 +514,13 @@ int CDECL MSVCRT__atoflt_l( MSVCRT__CRT_FLOAT *value, char *str, MSVCRT__locale_ ...@@ -514,13 +514,13 @@ int CDECL MSVCRT__atoflt_l( MSVCRT__CRT_FLOAT *value, char *str, MSVCRT__locale_
|MSVCRT__EM_OVERFLOW|MSVCRT__EM_UNDERFLOW|MSVCRT__EM_INEXACT, 0xffffffff); |MSVCRT__EM_OVERFLOW|MSVCRT__EM_UNDERFLOW|MSVCRT__EM_INEXACT, 0xffffffff);
if(exp>0) if(exp>0)
value->f = (float)sign*d*powf(10, exp); value->f = (double)sign*d*pow(10, exp);
else else
value->f = (float)sign*d/powf(10, -exp); value->f = (double)sign*d/pow(10, -exp);
_control87(fpcontrol, 0xffffffff); _control87(fpcontrol, 0xffffffff);
if((d && value->f==0.0) || isinf(value->f)) if((d && value->f>-MSVCRT_FLT_MIN && value->f<MSVCRT_FLT_MIN) || isinf(value->f))
ret = exp > 0 ? MSVCRT__OVERFLOW : MSVCRT__UNDERFLOW; ret = exp > 0 ? MSVCRT__OVERFLOW : MSVCRT__UNDERFLOW;
return ret; return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment