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
c8a6b9b6
Commit
c8a6b9b6
authored
Jul 14, 2001
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
long_format(): Simplify new code a bit.
parent
8600b47b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
Objects/longobject.c
Objects/longobject.c
+8
-5
No files found.
Objects/longobject.c
View file @
c8a6b9b6
...
...
@@ -840,17 +840,20 @@ long_format(PyObject *aa, int base, int addL)
Py_DECREF
(
str
);
return
NULL
;
})
while
(
--
ntostore
>=
0
)
{
assert
(
ntostore
>
0
);
do
{
digit
nextrem
=
(
digit
)(
rem
/
base
);
char
c
=
(
char
)(
rem
-
nextrem
*
base
);
assert
(
p
>
PyString_AS_STRING
(
str
));
c
+=
(
c
<
10
)
?
'0'
:
'A'
-
10
;
*--
p
=
c
;
rem
=
nextrem
;
if
(
a
->
ob_size
==
0
&&
rem
==
0
)
break
;
/* skip leading zeroes */
}
}
while
(
ABS
(
a
->
ob_size
)
!=
0
);
--
ntostore
;
/* Termination is a bit delicate: must not
store leading zeroes, so must get out if
a and rem are both 0 now. */
}
while
(
ntostore
&&
(
a
->
ob_size
||
rem
));
}
while
(
a
->
ob_size
!=
0
);
Py_DECREF
(
a
);
}
...
...
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