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
48b31569
Commit
48b31569
authored
Nov 06, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gofmt'ed big
R=agl
http://go/go-review/1022003
parent
7e92eedc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
arith_test.go
src/pkg/big/arith_test.go
+2
-2
int_test.go
src/pkg/big/int_test.go
+2
-2
nat.go
src/pkg/big/nat.go
+4
-4
No files found.
src/pkg/big/arith_test.go
View file @
48b31569
...
...
@@ -277,7 +277,7 @@ type mulWWTest struct {
var
mulWWTests
=
[]
mulWWTest
{
mulWWTest
{
_M
,
_M
,
_M
-
1
,
1
},
mulWWTest
{
_M
,
_M
,
_M
-
1
,
1
},
}
...
...
@@ -301,7 +301,7 @@ var mulAddWWWTests = []mulAddWWWTest{
// TODO(agl): These will only work on 64-bit platforms.
// mulAddWWWTest{15064310297182388543, 0xe7df04d2d35d5d80, 13537600649892366549, 13644450054494335067, 10832252001440893781},
// mulAddWWWTest{15064310297182388543, 0xdab2f18048baa68d, 13644450054494335067, 12869334219691522700, 14233854684711418382},
mulAddWWWTest
{
_M
,
_M
,
0
,
_M
-
1
,
1
},
mulAddWWWTest
{
_M
,
_M
,
0
,
_M
-
1
,
1
},
mulAddWWWTest
{
_M
,
_M
,
_M
,
_M
,
0
},
}
...
...
src/pkg/big/int_test.go
View file @
48b31569
...
...
@@ -100,8 +100,8 @@ var facts = map[int]string{
10
:
"3628800"
,
20
:
"2432902008176640000"
,
100
:
"933262154439441526816992388562667004907159682643816214685929"
"638952175999932299156089414639761565182862536979208272237582"
"51185210916864000000000000000000000000"
,
"638952175999932299156089414639761565182862536979208272237582"
"51185210916864000000000000000000000000"
,
}
...
...
src/pkg/big/nat.go
View file @
48b31569
...
...
@@ -437,14 +437,14 @@ func stringN(x []Word, base int) string {
// leadingZeroBits returns the number of leading zero bits in x.
func
leadingZeroBits
(
x
Word
)
int
{
c
:=
0
;
if
x
<
1
<<
(
_W
/
2
)
{
if
x
<
1
<<
(
_W
/
2
)
{
x
<<=
_W
/
2
;
c
=
int
(
_W
/
2
);
}
for
i
:=
0
;
x
!=
0
;
i
++
{
if
x
&
(
1
<<
(
_W
-
1
))
!=
0
{
return
i
+
c
;
return
i
+
c
;
}
x
<<=
1
;
}
...
...
@@ -458,7 +458,7 @@ func shiftLeft(dst, src []Word, n int) {
return
;
}
ñ
:=
uint
(
_W
)
-
uint
(
n
);
ñ
:=
uint
(
_W
)
-
uint
(
n
);
for
i
:=
len
(
src
)
-
1
;
i
>=
1
;
i
--
{
dst
[
i
]
=
src
[
i
]
<<
uint
(
n
);
dst
[
i
]
|=
src
[
i
-
1
]
>>
ñ
;
...
...
@@ -472,7 +472,7 @@ func shiftRight(dst, src []Word, n int) {
return
;
}
ñ
:=
uint
(
_W
)
-
uint
(
n
);
ñ
:=
uint
(
_W
)
-
uint
(
n
);
for
i
:=
0
;
i
<
len
(
src
)
-
1
;
i
++
{
dst
[
i
]
=
src
[
i
]
>>
uint
(
n
);
dst
[
i
]
|=
src
[
i
+
1
]
<<
ñ
;
...
...
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