News for hackers. Stuff that matters.
Re:Deep JavaScript: Theory and Techniques by mrspeaker on Wednesday June 17, 2020 @01:20PM (#23553999)
Now I'm curious what result the OP was expecting... that's how bitwise NOT should work on (IEEE 754) floating-point numbers regardless of the language, isn't it?

  (4.2).toString(2);
  > "100.00110011001100110011001100110011001100110011001101"
  (~4.2).toString(2);
  > "-101"
  (~~4.2).toString(2);
  > "100"
Perhaps the initial NOT is supposed to maintain the bits after the point? I have to go look at the spec.

[Ok, looks like that not defined in the spec, and is a language-specific behavior: I have some homework now!]

Re:Deep JavaScript: Theory and Techniques by XCSme on Wednesday June 17, 2020 @01:29PM (#23554131)
I think in C++ for example you can't even pass a floating number to the bitwise not operator.