Ad
  • Default User Avatar

    10000000010 = 1026,
    1026-1023 = 3,
    2^3 = 8,
    8 != 15

  • Custom User Avatar

    Use spoiler flag next time please.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Because by using Number.toString(2), you're converting the number to base 2, which is not what the kata is asking.

    What Number.toString(base) does is converting a decimal number to another base.
    Let's take for example -11.625. When calling toString(2) on it, you will get -1011.101 . This is because 11.625 is 2³ + 2¹ + 2⁰ + 2⁻¹ + 2⁻³

    But JavaScript doesnt use this representation to store -11.625, or any other Number. It represents it as a group of 64 bits following the IEEE 754 double-precision format.

    Before calling the toString(2) method, you have to find a way to read a Number as if it was a 64-bits integer.

    Hope I helped :)