Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d4814bfa
Commit
d4814bfa
authored
Mar 29, 2009
by
Mark Dickinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #532631: Apply floatformat changes to unicodeobject.c
as well as stringobject.c.
parent
174e9098
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
Objects/unicodeobject.c
Objects/unicodeobject.c
+9
-0
No files found.
Objects/unicodeobject.c
View file @
d4814bfa
...
@@ -8286,6 +8286,15 @@ formatfloat(Py_UNICODE *buf,
...
@@ -8286,6 +8286,15 @@ formatfloat(Py_UNICODE *buf,
return
-
1
;
return
-
1
;
if
(
prec
<
0
)
if
(
prec
<
0
)
prec
=
6
;
prec
=
6
;
/* make sure that the decimal representation of precision really does
need at most 10 digits: platforms with sizeof(int) == 8 exist! */
if
(
prec
>
0x7fffffffL
)
{
PyErr_SetString
(
PyExc_OverflowError
,
"outrageously large precision "
"for formatted float"
);
return
-
1
;
}
if
(
type
==
'f'
&&
fabs
(
x
)
>=
1e50
)
if
(
type
==
'f'
&&
fabs
(
x
)
>=
1e50
)
type
=
'g'
;
type
=
'g'
;
/* Worst case length calc to ensure no buffer overrun:
/* Worst case length calc to ensure no buffer overrun:
...
...
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