示例工程 02-values-variables-types

02-values-variables-types/expected/stdout.txt

text · 0.8 KB

[2.1] Int.max = 9223372036854775807
[2.1] Int.max &+ 1 = -9223372036854775808
[2.1] checkedAdd(Int.max, 1) = nil
[2.2] Int32(exactly: 3_000_000_000) = nil
[2.2] Int32(exactly: 42) = 42
[2.2] -7 % 3 = -1, 7 % -3 = 1
[2.3] 十次 0.1 相加 == 1.0:false
[2.3] 原始和 = 0.9999999999999999
[2.3] 保留三位 = 1.000
[2.3] 容差判等 = true
[2.3] NaN == NaN:false
[2.3] -0.0 == 0.0:true
[2.3] Decimal 0.1 × 10 == 1:true
[2.4] 带标签元组 = (x: 3, y: 4)
[2.4] 交换后 = (2, 1)
[2.4] 距离平方 = 25
[2.4] 解构 = x=7, y=9
[2.4] minMax = 1/9
[2.5] 分类 = zero/positive(7)
[2.5] 自增 = 42
[2.6] MemoryLayout<Int> = 8 字节
[2.6] MemoryLayout<Int32> = 4 字节
[2.6] MemoryLayout<Double> = 8 字节
[2.6] MemoryLayout<Decimal> = 20 字节
[2.6] MixedLayout size/stride/alignment = 16/16/8