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
a7f1af81
Commit
a7f1af81
authored
Sep 01, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor bugs
R=r OCL=14702 CL=14702
parent
33ee5272
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
11 deletions
+12
-11
align.c
src/cmd/6g/align.c
+4
-7
go.y
src/cmd/gc/go.y
+2
-0
pow.go
src/lib/math/pow.go
+1
-1
sqrt.go
src/lib/math/sqrt.go
+4
-2
tan.go
src/lib/math/tan.go
+1
-1
No files found.
src/cmd/6g/align.c
View file @
a7f1af81
...
@@ -102,10 +102,10 @@ dowidth(Type *t)
...
@@ -102,10 +102,10 @@ dowidth(Type *t)
{
{
uint32
w
;
uint32
w
;
w
=
0
;
if
(
t
==
T
)
if
(
t
==
T
)
return
;
return
;
w
=
0
;
switch
(
t
->
etype
)
{
switch
(
t
->
etype
)
{
default:
default:
fatal
(
"dowidth: unknown type: %E"
,
t
->
etype
);
fatal
(
"dowidth: unknown type: %E"
,
t
->
etype
);
...
@@ -123,13 +123,13 @@ dowidth(Type *t)
...
@@ -123,13 +123,13 @@ dowidth(Type *t)
case
TINT32
:
case
TINT32
:
case
TUINT32
:
case
TUINT32
:
case
TFLOAT32
:
case
TFLOAT32
:
case
TPTR32
:
case
TPTR32
:
// note lack of recursion
w
=
4
;
w
=
4
;
break
;
break
;
case
TINT64
:
case
TINT64
:
case
TUINT64
:
case
TUINT64
:
case
TFLOAT64
:
case
TFLOAT64
:
case
TPTR64
:
case
TPTR64
:
// note lack of recursion
w
=
8
;
w
=
8
;
break
;
break
;
case
TFLOAT80
:
case
TFLOAT80
:
...
@@ -158,11 +158,8 @@ dowidth(Type *t)
...
@@ -158,11 +158,8 @@ dowidth(Type *t)
w
=
wptr
;
w
=
wptr
;
break
;
break
;
case
TARRAY
:
case
TARRAY
:
if
(
t
->
bound
<
0
)
fatal
(
"width of a dynamic array"
);
if
(
t
->
type
==
T
)
break
;
dowidth
(
t
->
type
);
dowidth
(
t
->
type
);
if
(
t
->
bound
>=
0
&&
t
->
type
!=
T
)
w
=
t
->
bound
*
t
->
type
->
width
;
w
=
t
->
bound
*
t
->
type
->
width
;
break
;
break
;
...
...
src/cmd/gc/go.y
View file @
a7f1af81
...
@@ -943,6 +943,7 @@ Atype:
...
@@ -943,6 +943,7 @@ Atype:
|
Afntypeh
|
Afntypeh
|
'*'
Atype
|
'*'
Atype
{
{
dowidth
($
2
);
$$
=
ptrto
($
2
);
$$
=
ptrto
($
2
);
}
}
...
@@ -966,6 +967,7 @@ Btype:
...
@@ -966,6 +967,7 @@ Btype:
|
Bfntypeh
|
Bfntypeh
|
'*'
Btype
|
'*'
Btype
{
{
dowidth
($
2
);
$$
=
ptrto
($
2
);
$$
=
ptrto
($
2
);
}
}
|
'*'
lname
|
'*'
lname
...
...
src/lib/math/pow.go
View file @
a7f1af81
...
@@ -29,7 +29,7 @@ pow(arg1,arg2 float64) float64
...
@@ -29,7 +29,7 @@ pow(arg1,arg2 float64) float64
temp
=
floor
(
arg2
);
temp
=
floor
(
arg2
);
if
temp
!=
arg2
{
if
temp
!=
arg2
{
panic
sys
.
NaN
(
);
panic
(
sys
.
NaN
()
);
}
}
l
=
long
(
temp
);
l
=
long
(
temp
);
...
...
src/lib/math/sqrt.go
View file @
a7f1af81
...
@@ -49,9 +49,11 @@ sqrt(arg float64) float64
...
@@ -49,9 +49,11 @@ sqrt(arg float64) float64
exp
=
exp
+
60
;
exp
=
exp
+
60
;
}
}
if
exp
>=
0
{
if
exp
>=
0
{
temp
=
temp
*
float64
(
1
<<
(
exp
/
2
));
exp
=
1
<<
uint
(
exp
/
2
);
temp
=
temp
*
float64
(
exp
);
}
else
{
}
else
{
temp
=
temp
/
float64
(
1
<<
(
-
exp
/
2
));
exp
=
1
<<
uint
(
-
exp
/
2
);
temp
=
temp
/
float64
(
exp
);
}
}
for
i
=
0
;
i
<=
4
;
i
=
i
+
1
{
for
i
=
0
;
i
<=
4
;
i
=
i
+
1
{
...
...
src/lib/math/tan.go
View file @
a7f1af81
...
@@ -60,7 +60,7 @@ tan(arg float64) float64
...
@@ -60,7 +60,7 @@ tan(arg float64) float64
if
flag
{
if
flag
{
if
(
temp
==
0
)
{
if
(
temp
==
0
)
{
panic
sys
.
NaN
(
);
panic
(
sys
.
NaN
()
);
}
}
temp
=
1
/
temp
;
temp
=
1
/
temp
;
}
}
...
...
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