Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
如何计算 3D Morton 数(交织 3 个整数的位)
我正在寻找一种快速计算 3D Morton 数的方法 这个网站 http www graphics stanford edu seander bithacks html InterleaveBMN有一个基于幻数的技巧来处理 2D Morto
Algorithm
BitManipulation
zordercurve
如何手动(按位)执行(浮动)x?
现在 这是我应该实现的函数的函数头 float from int Return bit level equivalent of expression float x Result is returned as unsigned int bu
c
casting
floatingpoint
BitManipulation
如何在 JavaScript 中将 ArrayBuffer 与 DataView 结合使用
我见过的关于 ArrayBuffer 的唯一真正的教程来自HTML5摇滚 https www html5rocks com en tutorials webgl typed arrays 但我特别想知道如何操作各个字节 例如 这个carto
javascript
BitManipulation
ArrayBuffer
typedarrays
在第 i 个位置切换一点[重复]
这个问题在这里已经有答案了 可能的重复 如何在 C 中设置 清除和切换单个位 https stackoverflow com questions 47981 how do you set clear and toggle a single
c
BitManipulation
将 0x1234 转换为 0x11223344
如何高性能地将十六进制数0x1234扩展到0x11223344 unsigned int c 0x1234 b b c 0xff lt lt 4 c 0xf c 0xff0 lt lt 8 c 0xff00 lt lt 12 c 0xf00
c
BitManipulation
Java 将两个 int 存储在 long 中
我想将两个整数存储在一个 long 中 而不是必须创建一个新的Point每次都反对 目前 我尝试过这个 它不起作用 但我不知道它出了什么问题 x and y are ints long l x l l lt lt 32 y 我得到的 int
Java
BitManipulation
primitive
Golang 按位运算以及一般字节操作
我有一些 C 代码 可以对字节执行一些按位运算 我正在尝试在 golang 中做同样的事情 但遇到了困难 C 中的示例 byte a c byte data int j c data j c byte c j c a c 0xFF c 0x
go
Byte
BitManipulation
如何使用 C 替换位域中的位而不影响其他位
我想替换 32 64 位数据字段中的一位 位 多个位 而不影响其他位 举例来说 我有一个 64 位寄存器 其中第 5 位和第 6 位可以取值 0 1 2 和 3 5 6 0 0 0 1 1 0 1 1 现在 当我读取寄存器时 我得到的值是
c
BitManipulation
Java:用于标志检查的位运算
我试图检查一个数字是否有第二位标志 即 0000 0010 我的代码如下 int flags Integer parseInt fields 1 String strflags Integer toBinaryString flags fl
Java
BitManipulation
bit
operations
用于在 n LSBits 之后清除 m 位的掩码
我在一次采访中被问到这个问题 要清除 16 位整数的 n 位之后的 m 位 假设数字是 10010010010100101 清除 LSBit 中 5 位后的三位 之前 1001100111011001 之后 1001100100011001
c
BitManipulation
bit
将这个 if-then 逻辑转换为布尔表达式?
我在使这段代码更简洁 最好是单个布尔表达式 方面有点绞尽脑汁 这是我的代码 if d Unemployed if type Unemployed tmp Unemployed true else tmp Unemployed false
Algorithm
Binary
BitManipulation
booleanlogic
将 4 个字节转换为无符号 32 位整数并将其存储在 long 中
我正在尝试用 Java 读取二进制文件 我需要读取无符号 8 位值 无符号 16 位值和无符号 32 位值的方法 执行此操作的最佳 最快 最美观的代码 是什么 我在 C 中做到了这一点 并做了类似的事情 uint8 t buffer uin
Java
BitManipulation
2.9999999999999999 >> .5?
我听说您可以将数字右移 0 5 而不是使用 Math floor 我决定检查它的限制以确保它是合适的替代品 因此我检查了以下值并在 Google Chrome 中得到了以下结果 2 5 gt gt 5 2 2 9999 gt gt 5 2
javascript
BitManipulation
precision
在字节数组上进行右位旋转/循环移位的最快方法是什么
如果我有数组 01101111 11110000 00001111 111 240 15 移位 1 位的结果是 10110111 11111000 00000111 183 248 7 数组大小不固定 移位范围为 1 到 7 含 目前我有以
Java
performance
Optimization
BitManipulation
如何从 8 个布尔值中创建一个字节(反之亦然)?
我有8个bool变量 我想将它们 合并 成一个字节 有没有一种简单 首选的方法可以做到这一点 反过来 将一个字节解码为 8 个独立的布尔值怎么样 我进来假设这不是一个不合理的问题 但由于我无法通过谷歌找到相关文档 这可能是另一种 nonon
c
Boolean
BitManipulation
bitpacking
负整数的Python表示
gt gt gt x 4 gt gt gt print b format x x 4 100 gt gt gt mask 0xFFFFFFFF gt gt gt print b format x mask x mask 4294967292
python
Integer
BitManipulation
计算 Int32 中的前导零
如何计算一个数组中的前导零Int32 所以我想做的是写一个函数 如果我的输入是 2 它返回 30 因为在二进制中我有000 0000000000010 NOTE使用 dotnet core gt 3 0 看here https stacko
c
count
int
BitManipulation
leadingzero
C 中的位移位
如果与有符号整数对应的位模式右移 则 1 vacant bit will be filled by the sign bit 2 vacant bit will be filled by 0 3 The outcome is impleme
c
BitManipulation
不使用“-”运算符将两个数字相减
我尝试使用以下代码 但我不明白为什么它给了我错误的答案 我正在计算 2 的补码并添加另一个数字 include
c
BitManipulation
为什么 n & (n - 1) 总是从 n 中清除 1 位?
给定一个数字n 按位运算n n 1 总是产生一个与 1 位相差的数字n 以下是一些示例 n 4 gt b 100 b 011 b 000 n 5 gt b 101 b 100 b 100 n 6 gt b 110 b 101 b 100 换
BitManipulation
1
2
3
4
5
6
...21
»