Skip to content

Commit 247d89c

Browse files
committed
修正整数范围的内容,新增未翻译的部份
1 parent 0b186bc commit 247d89c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

source-tw/chapter2/01_The_Basics.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Swift 中的註釋與C 語言的註釋非常相似。單行註釋以雙正斜槓
182182

183183
```swift
184184
let cat = "□□ println(cat)
185-
// 輸出 "□□
185+
// 輸出 "□□
186186
```
187187

188188
<a name="integers"></a>
@@ -197,9 +197,10 @@ Swift 提供了8,16,32和64位的有符號和無符號整數類型。這些
197197
你可以訪問不同整數類型的`min``max`屬性來獲取對應類型的最大值和最小值:
198198

199199
```swift
200-
let minValue = UInt8.min // minValue 為 0,是 UInt8 類型的最小值
201-
let maxValue = UInt8.max // maxValue 為 255,是 UInt8 類型的最大值
200+
let minValue = UInt8.min // minValue 為 0,且是Uint8型別
201+
let maxValue = UInt8.max // maxValue 為 255,且是UInt8型別
202202
```
203+
`min``max`所傳回值的型別,正是其所對應的整數型別(如上UInt8,所傳回的型別為UInt8),且可用在陳述式相同型别的值旁。
203204

204205
### Int
205206

source/chapter2/01_The_Basics.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,10 @@ Swift 提供了8,16,32和64位的有符号和无符号整数类型。这些
197197
你可以访问不同整数类型的`min``max`属性来获取对应类型的最大值和最小值:
198198

199199
```swift
200-
let minValue = UInt8.min // minValue 为 0,是 UInt8 类型的最小值
201-
let maxValue = UInt8.max // maxValue 为 255,是 UInt8 类型的最大值
202-
```
200+
let minValue = UInt8.min // minValue 为 0,是 UInt8 类型
201+
let maxValue = UInt8.max // maxValue 为 255,是 UInt8 类型
202+
```
203+
`min``max`所传回值的类型,正是其所对的整数类型(如上例UInt8, 所传回的类型是UInt8),可用在表达式中相同类型值旁。
203204

204205
### Int
205206

0 commit comments

Comments
 (0)