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
3132a5a7
Commit
3132a5a7
authored
Mar 27, 1992
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
answer lint's complaints
parent
f1aeab7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
Objects/floatobject.c
Objects/floatobject.c
+13
-5
No files found.
Objects/floatobject.c
View file @
3132a5a7
...
...
@@ -64,6 +64,13 @@ newfloatobject(fval)
return
(
object
*
)
op
;
}
void
float_dealloc
(
op
)
object
*
op
;
{
DEL
(
op
);
}
double
getfloatvalue
(
op
)
object
*
op
;
...
...
@@ -106,11 +113,12 @@ float_buf_repr(buf, v)
}
}
/* ARGSUSED */
static
int
float_print
(
v
,
fp
,
flags
)
floatobject
*
v
;
FILE
*
fp
;
int
flags
;
int
flags
;
/* Not used but required by interface */
{
char
buf
[
100
];
float_buf_repr
(
buf
,
v
);
...
...
@@ -178,7 +186,7 @@ float_rem(v, w)
floatobject
*
w
;
{
double
vx
,
wx
;
double
div
,
mod
;
double
/* div, */
mod
;
wx
=
w
->
ob_fval
;
if
(
wx
==
0
.
0
)
{
err_setstr
(
ZeroDivisionError
,
"float modulo"
);
...
...
@@ -186,10 +194,10 @@ float_rem(v, w)
}
vx
=
v
->
ob_fval
;
mod
=
fmod
(
vx
,
wx
);
div
=
(
vx
-
mod
)
/
wx
;
/* div = (vx - mod) / wx; */
if
(
wx
*
mod
<
0
)
{
mod
+=
wx
;
div
-=
1
.
0
;
/* div -= 1.0; */
}
return
newfloatobject
(
mod
);
}
...
...
@@ -317,7 +325,7 @@ typeobject Floattype = {
"float"
,
sizeof
(
floatobject
),
0
,
f
ree
,
/*tp_dealloc*/
f
loat_dealloc
,
/*tp_dealloc*/
float_print
,
/*tp_print*/
0
,
/*tp_getattr*/
0
,
/*tp_setattr*/
...
...
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