Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
ce85868a
Commit
ce85868a
authored
Feb 05, 2010
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug in const float divide
R=rsc CC=golang-dev
https://golang.org/cl/204042
parent
072b560e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
mparith2.c
src/cmd/gc/mparith2.c
+14
-1
No files found.
src/cmd/gc/mparith2.c
View file @
ce85868a
...
@@ -618,6 +618,19 @@ mpdivmodfixfix(Mpint *q, Mpint *r, Mpint *n, Mpint *d)
...
@@ -618,6 +618,19 @@ mpdivmodfixfix(Mpint *q, Mpint *r, Mpint *n, Mpint *d)
q
->
neg
=
ns
^
ds
;
q
->
neg
=
ns
^
ds
;
}
}
int
iszero
(
Mpint
*
a
)
{
long
*
a1
;
int
i
;
a1
=
&
a
->
a
[
0
]
+
Mpprec
;
for
(
i
=
0
;
i
<
Mpprec
;
i
++
)
{
if
(
*--
a1
!=
0
)
return
0
;
}
return
1
;
}
void
void
mpdivfract
(
Mpint
*
a
,
Mpint
*
b
)
mpdivfract
(
Mpint
*
a
,
Mpint
*
b
)
{
{
...
@@ -632,12 +645,12 @@ mpdivfract(Mpint *a, Mpint *b)
...
@@ -632,12 +645,12 @@ mpdivfract(Mpint *a, Mpint *b)
neg
=
n
.
neg
^
d
.
neg
;
neg
=
n
.
neg
^
d
.
neg
;
n
.
neg
=
0
;
n
.
neg
=
0
;
d
.
neg
=
0
;
d
.
neg
=
0
;
for
(
i
=
0
;
i
<
Mpprec
;
i
++
)
{
for
(
i
=
0
;
i
<
Mpprec
;
i
++
)
{
x
=
0
;
x
=
0
;
for
(
j
=
0
;
j
<
Mpscale
;
j
++
)
{
for
(
j
=
0
;
j
<
Mpscale
;
j
++
)
{
x
<<=
1
;
x
<<=
1
;
if
(
mpcmp
(
&
d
,
&
n
)
<=
0
)
{
if
(
mpcmp
(
&
d
,
&
n
)
<=
0
)
{
if
(
!
iszero
(
&
d
))
x
|=
1
;
x
|=
1
;
mpsubfixfix
(
&
n
,
&
d
);
mpsubfixfix
(
&
n
,
&
d
);
}
}
...
...
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