From 40a6c2b986c9178eaf5b94081ab04aa4c1db88ce Mon Sep 17 00:00:00 2001 From: polunzh Date: Sat, 16 Nov 2019 22:29:07 -0600 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=964.3=E7=AB=A0?= =?UTF-8?q?=E4=B8=AD=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F=20(#736)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eBook/04.3.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eBook/04.3.md b/eBook/04.3.md index dfe502c..3079465 100644 --- a/eBook/04.3.md +++ b/eBook/04.3.md @@ -12,7 +12,7 @@ const Pi = 3.14159 在 Go 语言中,你可以省略类型说明符 `[type]`,因为编译器可以根据变量的值来推断其类型。 -- 显式类型定义: `const b string = "abc"` +- 显式类型定义: `const b string = "abc"` - 隐式类型定义: `const b = "abc"` 一个没有指定类型的常量被使用时,会根据其使用环境而推断出它所需要具备的类型。换句话说,未定义类型的常量会在必要时刻根据上下文来获得相关类型。 @@ -32,9 +32,9 @@ f(n + 5) // 无类型的数字型常量 “5” 它的类型在这里变成了 i 数字型的常量是没有大小和符号的,并且可以使用任何精度而不会导致溢出: ```go -const Ln2= 0.693147180559945309417232121458\ +const Ln2 = 0.693147180559945309417232121458\ 176568075500134360255254120680009 -const Log2E= 1/Ln2 // this is a precise reciprocal +const Log2E = 1/Ln2 // this is a precise reciprocal const Billion = 1e9 // float constant const hardEight = (1 << 100) >> 97 ```