繁体   English   中英

Android Renderscript rotationLeft

[英]Android Renderscript rotateLeft

如何实现此Java函数:

    public static int rotateLeft(int i, int distance) {
        // Shift distances are mod 32 (JLS3 15.19), so we needn't mask -distance
        return (i << distance) | (i >>> -distance);
    }

Renderscript中

和C一样,所以类似

static int rotateLeft(int i, int distance) {
  return (i << (distance % 32)) | ((unsigned int)i >> (32 - (distance % 32)));
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM