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
313c1efb
Commit
313c1efb
authored
Jun 03, 1991
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix conversion of double to long; stylistic changes.
parent
c6d2db91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Python/bltinmodule.c
Python/bltinmodule.c
+3
-3
No files found.
Python/bltinmodule.c
View file @
313c1efb
...
...
@@ -171,7 +171,6 @@ builtin_float(self, v)
return
newfloatobject
((
double
)
x
);
}
else
if
(
is_longobject
(
v
))
{
extern
double
dgetlongvalue
();
return
newfloatobject
(
dgetlongvalue
(
v
));
}
else
if
(
is_floatobject
(
v
))
{
...
...
@@ -215,12 +214,13 @@ builtin_int(self, v)
else
if
(
is_longobject
(
v
))
{
long
x
;
x
=
getlongvalue
(
v
);
if
(
x
==
-
1
&&
err_occurred
())
if
(
err_occurred
())
return
NULL
;
return
newintobject
(
x
);
}
else
if
(
is_floatobject
(
v
))
{
double
x
=
getfloatvalue
(
v
);
/* XXX should check for overflow */
return
newintobject
((
long
)
x
);
}
err_setstr
(
TypeError
,
"int() argument must be int, long or float"
);
...
...
@@ -269,7 +269,7 @@ builtin_long(self, v)
}
else
if
(
is_floatobject
(
v
))
{
double
x
=
getfloatvalue
(
v
);
return
newlongobject
((
long
)
x
);
return
dnewlongobject
(
x
);
}
err_setstr
(
TypeError
,
"long() argument must be int, long or float"
);
return
NULL
;
...
...
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