Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
4d44d6a3
Commit
4d44d6a3
authored
Dec 09, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
missed a couple of files in test
R=rsc, r
https://golang.org/cl/172045
parent
542099d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
18 deletions
+27
-18
test/chan/powser2.go
test/chan/powser2.go
+24
-12
test/simassign.go
test/simassign.go
+3
-6
No files found.
test/chan/powser2.go
View file @
4d44d6a3
...
@@ -28,8 +28,11 @@ type item interface {
...
@@ -28,8 +28,11 @@ type item interface {
}
}
func
(
u
*
rat
)
pr
(){
func
(
u
*
rat
)
pr
(){
if
u
.
den
==
1
{
print
(
u
.
num
)
}
if
u
.
den
==
1
{
else
{
print
(
u
.
num
,
"/"
,
u
.
den
)
}
print
(
u
.
num
)
}
else
{
print
(
u
.
num
,
"/"
,
u
.
den
)
}
print
(
" "
)
print
(
" "
)
}
}
...
@@ -273,8 +276,7 @@ func inv(u *rat) *rat{ // invert a rat
...
@@ -273,8 +276,7 @@ func inv(u *rat) *rat{ // invert a rat
}
}
// print eval in floating point of PS at x=c to n terms
// print eval in floating point of PS at x=c to n terms
func
Evaln
(
c
*
rat
,
U
PS
,
n
int
)
func
Evaln
(
c
*
rat
,
U
PS
,
n
int
)
{
{
xn
:=
float64
(
1
);
xn
:=
float64
(
1
);
x
:=
float64
(
c
.
num
)
/
float64
(
c
.
den
);
x
:=
float64
(
c
.
num
)
/
float64
(
c
.
den
);
val
:=
float64
(
0
);
val
:=
float64
(
0
);
...
@@ -294,8 +296,11 @@ func Printn(U PS, n int){
...
@@ -294,8 +296,11 @@ func Printn(U PS, n int){
done
:=
false
;
done
:=
false
;
for
;
!
done
&&
n
>
0
;
n
--
{
for
;
!
done
&&
n
>
0
;
n
--
{
u
:=
get
(
U
);
u
:=
get
(
U
);
if
end
(
u
)
!=
0
{
done
=
true
}
if
end
(
u
)
!=
0
{
else
{
u
.
pr
()
}
done
=
true
}
else
{
u
.
pr
()
}
}
}
print
((
"
\n
"
));
print
((
"
\n
"
));
}
}
...
@@ -357,8 +362,11 @@ func Cmul(c *rat,U PS) PS{
...
@@ -357,8 +362,11 @@ func Cmul(c *rat,U PS) PS{
for
!
done
{
for
!
done
{
<-
Z
.
req
;
<-
Z
.
req
;
u
:=
get
(
U
);
u
:=
get
(
U
);
if
end
(
u
)
!=
0
{
done
=
true
}
if
end
(
u
)
!=
0
{
else
{
Z
.
dat
<-
mul
(
c
,
u
)
}
done
=
true
}
else
{
Z
.
dat
<-
mul
(
c
,
u
)
}
}
}
Z
.
dat
<-
finis
;
Z
.
dat
<-
finis
;
}(
c
,
U
,
Z
);
}(
c
,
U
,
Z
);
...
@@ -474,8 +482,9 @@ func Diff(U PS) PS{
...
@@ -474,8 +482,9 @@ func Diff(U PS) PS{
done
:=
false
;
done
:=
false
;
for
i
:=
1
;
!
done
;
i
++
{
for
i
:=
1
;
!
done
;
i
++
{
u
=
get
(
U
);
u
=
get
(
U
);
if
end
(
u
)
!=
0
{
done
=
true
}
if
end
(
u
)
!=
0
{
else
{
done
=
true
}
else
{
Z
.
dat
<-
mul
(
itor
(
int64
(
i
)),
u
);
Z
.
dat
<-
mul
(
itor
(
int64
(
i
)),
u
);
<-
Z
.
req
;
<-
Z
.
req
;
}
}
...
@@ -569,8 +578,11 @@ func Subst(U, V PS) PS {
...
@@ -569,8 +578,11 @@ func Subst(U, V PS) PS {
u
:=
get
(
U
);
u
:=
get
(
U
);
Z
.
dat
<-
u
;
Z
.
dat
<-
u
;
if
end
(
u
)
==
0
{
if
end
(
u
)
==
0
{
if
end
(
get
(
VV
[
0
]))
!=
0
{
put
(
finis
,
Z
);
}
if
end
(
get
(
VV
[
0
]))
!=
0
{
else
{
copy
(
Mul
(
VV
[
0
],
Subst
(
U
,
VV
[
1
])),
Z
);
}
put
(
finis
,
Z
);
}
else
{
copy
(
Mul
(
VV
[
0
],
Subst
(
U
,
VV
[
1
])),
Z
);
}
}
}
}(
U
,
V
,
Z
);
}(
U
,
V
,
Z
);
return
Z
;
return
Z
;
...
...
test/simassign.go
View file @
4d44d6a3
...
@@ -9,14 +9,12 @@ package main
...
@@ -9,14 +9,12 @@ package main
var
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
int
;
var
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
int
;
func
func
printit
()
printit
()
{
{
println
(
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
);
println
(
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
);
}
}
func
func
testit
(
permuteok
bool
)
bool
testit
(
permuteok
bool
)
bool
{
{
if
a
+
b
+
c
+
d
+
e
+
f
+
g
+
h
+
i
!=
45
{
if
a
+
b
+
c
+
d
+
e
+
f
+
g
+
h
+
i
!=
45
{
print
(
"sum does not add to 45
\n
"
);
print
(
"sum does not add to 45
\n
"
);
printit
();
printit
();
...
@@ -40,8 +38,7 @@ swap(x, y int) (u, v int) {
...
@@ -40,8 +38,7 @@ swap(x, y int) (u, v int) {
}
}
func
func
main
()
main
()
{
{
a
=
1
;
a
=
1
;
b
=
2
;
b
=
2
;
c
=
3
;
c
=
3
;
...
...
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