[.NET] 奇怪的數值問題
Public Sub caraction(ByVal steps As Integer, ByVal character As String)
Dim temp5, temp4, temp3, temp2, temp1, a, b, c, d, e As Integer
temp5 = steps / 10000
a = steps Mod 10000
temp4 = a / 1000
b = a Mod 1000
temp3 = b / 100
c = b Mod 100
temp2 = c / 10
temp1 = c Mod 10
假如我的steps是64的話
會得到temp5=0 temp4=0 temp3=1 temp2=6 temp1=4
位什麼會出現這麼奇怪的結果?
煩請大家幫忙一下摟,謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.121.135.238
推
08/13 22:03, , 1F
08/13 22:03, 1F
→
08/13 22:04, , 2F
08/13 22:04, 2F
→
08/13 22:05, , 3F
08/13 22:05, 3F
推
08/13 23:14, , 4F
08/13 23:14, 4F
→
08/13 23:18, , 5F
08/13 23:18, 5F
推
08/14 00:03, , 6F
08/14 00:03, 6F
→
08/14 00:03, , 7F
08/14 00:03, 7F