Re: [VB6 ] 長久以來的疑惑
: 推 beyonds999:Integer 也是兩個byte 03/10 19:28
那個比較有道理,我反而覺得C的int 跟 long 都 4 Bytes 極詭異
反正寫VB因為Integer太小不會沒顧慮到溢位
查了Wiki ,似乎Boolean就是Integer
Boolean constant True has numeric value -1 .
This is because the Boolean data type is stored as a 16-bit signed integer.
In this construct -1 evaluates to 16 binary 1s (the Boolean value True),
and 0 as 16 0s (the Boolean value False).
This is apparent when performing a Not operation on a 16 bit signed integer
value 0 which will return the integer value -1 , in other words
True = Not False. This inherent functionality becomes
especially useful when performing logical operations on the individual bits
of an integer such as And, Or, Xor and Not. This definition of True is also
consistent with BASIC since the early 1970s Microsoft BASIC implementation
and is also related to the characteristics of microprocessor instructions at
the time.
--
┬ ██ ██ ██ ██◣ ████◣ ████◣ ◢███▍█ ┌┤
┼┼ ◥█ ██◤ ██ ██ ██ ██◣ ██ ██◣ ██▄▄▄▄ ┼┐
│ ◢█ ██◣ ██ ██ ██ ██ ██ ██ ▄▄▄▄██ ┌┤
┌┼ ██ ██ █████◤ █████◤ █████◤ █████◤ │
歡迎大家來 叉滴小站 開個人版喔 telnet://XDBBS.twbbs.org or telnet://ACGer.tw
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.112.40.3
討論串 (同標題文章)