News for hackers. Stuff that matters.
Re:4B If Statements by timrobinson333 on Thursday December 28, 2023 @07:14AM (#38792698)
I'm afraid I take issue with the phrase "amazingly performant". I would struggle to come up with another way of determining whether a number near 2^32 is even that takes anything like 10 seconds
Re:4B If Statements by christophilus on Thursday December 28, 2023 @09:36AM (#38793831)
I'd bet this is slower:

    function isEven(n) {
      let arr = [];
      let sign = -1;
      for (let i = 0; i < Math.abs(n); ++i) {
        arr = [...arr, sign];
        sign *= -1;
      }
      return arr.length === 0 || arr.reduce((a, b) => a + b) === 0;
    }
But I'm not going to test it, because I'm doing productive things on my computer right now, and don't want to OOM.

Sadly, the OP missed an opportunity to call his program "blazingly fast" [0].

[0] https://www.youtube.com/results?search_query=primagen+blazin...