Skip to content

Commit a91ae34

Browse files
committed
Fix japanese book missing src folder preventing book to be built
1 parent f5182cb commit a91ae34

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

ja/src

-1
This file was deleted.

ja/src/.DS_Store

6 KB
Binary file not shown.

ja/src/1.2/main.go

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// 章节 1.2
2+
// $GOPATH/src/mathapp/main.go
3+
4+
package main
5+
6+
import (
7+
"fmt"
8+
"mymath"
9+
)
10+
11+
func main() {
12+
fmt.Printf("Hello, world. Sqrt(2) = %v\n", mymath.Sqrt(2))
13+
}

ja/src/1.2/sqrt.go

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// 章节 1.2
2+
// $GOPATH/src/mymath/sqrt.go
3+
package mymath
4+
5+
func Sqrt(x float64) float64 {
6+
z := 0.0
7+
for i := 0; i < 1000; i++ {
8+
z -= (z*z - x) / (2 * x)
9+
}
10+
return z
11+
}

0 commit comments

Comments
 (0)