-1 的使用让我感到困惑。我原以为这些值是:
使用 -1 而不是 +1 背后是否有历史原因?
正如此处堆栈溢出所讨论的,Yes/True值在 Access 中显示为 -1,因为
Yes/NoAccess 中的bit字段模拟字段,IntegerAccess 中的值是有符号的,二进制补码值,No/False 由 0 表示,并且 3 位:
bits integer
---- -------
000 0
001 1
010 2
011 3
100 -4
101 -3
110 -2
111 -1
Run Code Online (Sandbox Code Playgroud)
2 位:
bits integer
---- -------
00 0
01 1
10 -2
11 -1
Run Code Online (Sandbox Code Playgroud)
1 位:
bits integer
---- -------
0 0
1 -1
Run Code Online (Sandbox Code Playgroud)
对于bit字段的整数表示(即 1 位),如果 0 是No/False那么唯一可用的其他值Yes/True是 -1。
| 归档时间: |
|
| 查看次数: |
19158 次 |
| 最近记录: |