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
9cdb8bd5
Commit
9cdb8bd5
authored
Oct 29, 2008
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor int/float fixes
R=ken OCL=18032 CL=18032
parent
11a978ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
float_lit.go
test/float_lit.go
+3
-3
utf.go
test/utf.go
+2
-2
No files found.
test/float_lit.go
View file @
9cdb8bd5
...
...
@@ -7,7 +7,7 @@
package
main
func
pow10
(
pow
int
)
double
pow10
(
pow
int
)
float64
{
if
pow
<
0
{
return
1
/
pow10
(
-
pow
);
}
if
pow
>
0
{
return
pow10
(
pow
-
1
)
*
10
;
}
...
...
@@ -15,9 +15,9 @@ pow10(pow int) double
}
func
close
(
da
double
,
ia
,
ib
int64
,
pow
int
)
bool
close
(
da
float64
,
ia
,
ib
int64
,
pow
int
)
bool
{
db
:=
double
(
ia
)
/
double
(
ib
);
db
:=
float64
(
ia
)
/
float64
(
ib
);
db
*=
pow10
(
pow
);
if
da
==
0
{
...
...
test/utf.go
View file @
9cdb8bd5
...
...
@@ -20,7 +20,7 @@ func main() {
}
var
l
=
len
(
s
);
for
w
,
i
,
j
:=
0
,
0
,
0
;
i
<
l
;
i
+=
w
{
var
r
int
32
;
var
r
int
;
r
,
w
=
sys
.
stringtorune
(
s
,
i
);
if
w
==
0
{
panic
(
"zero width in string"
)
}
if
r
!=
chars
[
j
]
{
panic
(
"wrong value from string"
)
}
...
...
@@ -43,7 +43,7 @@ func main() {
a
[
10
]
=
0xaa
;
a
[
11
]
=
0x9e
;
for
w
,
i
,
j
:=
0
,
0
,
0
;
i
<
L
;
i
+=
w
{
var
r
int
32
;
var
r
int
;
r
,
w
=
sys
.
bytestorune
(
&
a
[
0
],
i
,
L
);
if
w
==
0
{
panic
(
"zero width in bytes"
)
}
if
r
!=
chars
[
j
]
{
panic
(
"wrong value from bytes"
)
}
...
...
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