1. 28
  1. 17

    Perhaps I shouldn’t have been, but I was surprised to see that this was patentable:

    There’s another algorithm that doesn’t depend on knowing which value is larger, the U.S. patent for which expired in 2016:

    unsigned average(unsigned a, unsigned b)
    {
        return (a / 2) + (b / 2) + (a & b & 1);
    }
    
    1. 9

      I’m not sure what the policy is now, but in the ‘90s there was the pretty awful situation where the US patent office had a policy that if a software patent doesn’t have prior art then it should be granted and the courts can figure out if it’s valid (in part because the patent office didn’t have the expertise to judge whether something was non-obvious and in part because patent filing is expensive and the US government is broadly in favour of receiving money). Simultaneously, the courts had a policy that a granted patent was probably valid and the burden of proof was for the people challenging it to do so.

      The cost of either defending or challenging a patent was around $1m, so everyone filed a load of patents on anything that they could, no matter how silly (Microsoft had one on the is-not-identical-to operator in Visual Basic, for example), so that they could guarantee that all of their competitors were violating a load of patents and it was mutually assured destruction for anyone to actually try to enforce a patent.

      The MAD strategy started to fail with the dot-com crash. A load of companies that had filed patents during this era went bankrupt and their assets were sold for next to nothing to patent troll companies (non-practicing entities). These companies weren’t worried about MAD because they were not violating any patents because they didn’t produce anything.

      I think the situation has improved a bit since then.

      1. 1

        From the patent title it sounds like it was about a hardware implementation, which is slightly more plausible, but yeah.

        Pretty clever, though!

        1. 2

          That could also be because “software” was not patentable (it gets copyright), but a machine is. So you got a absurd number of parents describing computers that did like a single thing, which is daft whether you think software patents are BS or not.

        2. 1

          Software patents were really out of hand in 1990s America. I heard that the situation somewhat improved now.

        3. 2

          This is one of those things that I “know”, but if I were to be writing code and then need the average of two integers I can almost guarantee I would do it the incorrect obvious way :D