Daniel Lemire's blog

, 7 min read

A review of elementary data types : numbers and strings

12 thoughts on “A review of elementary data types : numbers and strings”

  1. Some Person says:

    Typo: “We may also use the hexadecimal (base 16) notation with the 0x prefix: in that case, we use 16 different digits in the list 0, 1, 2, 3,…, 9, A, B, C, D, E, F. These digits have values 0, 1, 2, 3,…, 9, 10, 11, 12, 13, 14, 16”

    As you well know, that “16” should be “15”.

    1. Thanks.

    2. Manish Kumar says:

      -513 should not it be -3*256+255, so it would map to 255

      1. Thanks.

  2. alexey says:

    could you please change “As 256-bit integers, they are mapped to” to either “as 256-modulo integers” or “8-bit integers”?

    1. Correct. Thanks.

  3. mz says:

    Typo : “The UTF-16 format can represent all characters, except for the supplemental characters such as emojis, using **two** bytes”

    it should be “four” instead of “two”

    1. It is indeed two, there is no error.

  4. mz says:

    Typo : “For example, the bitwise AND between 0b101 and 0b1100 is 0b100. The bitwise OR is **0b1111**. The bitwise XOR (exclusive OR) is 0b1001.”

    It should be “0b1101” instead of “0b1111”

    1. Thank you.

  5. mz says:

    Typo : “For example, 17 is 0b10001. Multiplying it by 4, we get 0b1000100 or 68. If we were to multiply **17** by 4, we would get 0b100010000 or, as an 8-bit integer, 0b10000. That is, as 8-bit unsigned integers, we have that 17 * 16 is 16. Thus we have that 17 * 16 == 1 * 16.”

    It should be “68” instead of “17” between asterisks

    1. Thanks.