Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
74ec93ba
Commit
74ec93ba
authored
Nov 05, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Improved scanf precision.
parent
34951f31
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
scanf.h
dlls/msvcrt/scanf.h
+21
-2
No files found.
dlls/msvcrt/scanf.h
View file @
74ec93ba
...
...
@@ -310,9 +310,11 @@ _FUNCTION_ {
case
'f'
:
case
'g'
:
case
'G'
:
{
/* read a float */
long
double
cur
;
long
double
cur
=
1
,
expcnt
=
10
;
ULONGLONG
d
,
hlp
;
int
exp
=
0
,
negative
=
0
;
unsigned
fpcontrol
;
BOOL
negexp
;
/* skip initial whitespace */
while
((
nch
!=
_EOF_
)
&&
_ISSPACE_
(
nch
))
...
...
@@ -401,7 +403,24 @@ _FUNCTION_ {
else
exp
+=
e
;
}
cur
=
(
exp
>=
0
?
d
*
pow
(
10
,
exp
)
:
d
/
pow
(
10
,
-
exp
));
fpcontrol
=
_control87
(
0
,
0
);
_control87
(
MSVCRT__EM_DENORMAL
|
MSVCRT__EM_INVALID
|
MSVCRT__EM_ZERODIVIDE
|
MSVCRT__EM_OVERFLOW
|
MSVCRT__EM_UNDERFLOW
|
MSVCRT__EM_INEXACT
,
0xffffffff
);
negexp
=
(
exp
<
0
);
if
(
negexp
)
exp
=
-
exp
;
/* update 'cur' with this exponent. */
while
(
exp
)
{
if
(
exp
&
1
)
cur
*=
expcnt
;
exp
/=
2
;
expcnt
=
expcnt
*
expcnt
;
}
cur
=
(
negexp
?
d
/
cur
:
d
*
cur
);
_control87
(
fpcontrol
,
0xffffffff
);
st
=
1
;
if
(
!
suppress
)
{
if
(
L_prefix
)
_SET_NUMBER_
(
double
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment