全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Shift?

又称: shift (bit shift)

Definition 3.10 High School Computer Science · 第 3 章 — Integers in the Machine

A shift moves every bit of a number by kk positions: a << k to the left, adding kk zeros on the right, and a >> k to the right, dropping the kk rightmost bits. For a whole number a≥0a \ge 0, a << k is a×2ka \times 2^k and a >> k is the quotient a // 2**k.

在原文中阅读 →