5 ms·
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, uns
by nmilo 5y ago
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);
}
There's no way that should be patentable.
- coutego 5y agoExactly. I saw the title, thought "I wonder what other way there is to do this than the obvious one of pre-dividing by 2" and then opened the article and saw that the trivial way to do it was covered by a patent. Wow! Just wow...
- amelius 5y agoWell, we're the ones allowing the patent scam to continue ...
- version_five 5y agoYeah, when I read the article title, this is how I thought I would do it. Anything that obvious is not patentable in principle, but in practice, Samsung could still destroy any small business it wanted to by taking them to court over it. The patent system is awful
- deleted 5y ago[deleted]
- throwaway22032 5y agoThat's utterly hilarious. I've never come across this problem before, I read the headline and that solution came into my head immediately before I'd even clicked. I don't think I'm clever, surely half of HN feels the same way. Software patents are comical.
- staticassertion 5y agoThe article is in error. It isn't patented.
- quickthrower2 5y agoIt is crazy. Can we get a computer program to spit out thousands of obvious simple programs, get FOSS to use them in various places for prior art to avoid this happening.
- TYPE_FASTER 5y agoAnother semi-famous software patent: https://patents.google.com/patent/US20040230959A1/en https://patents.google.com/patent/US20040230959A1/en
- lilyball 5y agoAlgorithms aren't patentable. What's patented here is a specific circuit that implements this algorithm in order to calculate the average in a single instruction cycle.
- nmilo 5y agoYeah you're right, it seems like the article is misleading. Still, unless I'm reading it wrong it seems like the patent is just describing the hardware translation of this algorithm, it's not really adding anything new. It's still dubious to me.
- dlubarov 5y agoYeah, isn't the translation to a circuit even more trivial than the algorithm itself? a / 2 and b / 2 just discard bits. a & b & 1 is just an and of the two low bits. Then we just route those values to an adder (with carry).
- WalterBright 5y agoThe XOR cursor was patented.
- erosenbe0 5y agoProbably years after it was implemented too Edit: but back in the 70s the USPTO didn't have the search databases they had in the 90s or 2000s. It's more the XOR patent being wielded in litigation that was extra controversial
- rrss 5y agoI disagree. Not all the claims include the “single instruction cycle,” and IMO several of the claims are general enough that one could make a case that a sequence of instructions directing the operation of a general purpose data path would be covered by the claim. (Claim 3, for example). this would require a lawsuit to find out, but this wording in the description suggests the authors’ intent with the claims was to patent this method of computing an average on any processor: > A general purpose computer or processor with suitable circuitry can execute the invention in a single instruction cycle (as is preferred) or multiple instruction cycles.
- StayTrue 5y agoDo bitwise shifts instead of dividing by 2. (BRB going to the patent office.)
- CyberDildonics 5y agoThe compiler will do that for you and dividing by 2 is much clearer.
- paxys 5y agoIt shouldn't be, but the world of software patents is truly bizarre. I have several patents in my name that are completely meaningless to the point of being satirical (stuff like "system to show a list of options and dispatch and action to a web server", "validating information submitted in a web form and returning errors"). Each is 40+ pages of filing, complete with diagrams, and all of them approved. And we need to do it otherwise someone will sue us with an equally bogus patent and we will have no defense.
- danuker 5y ago> no defense. I am not a lawyer, but I suspect prior art is a defense.
- staticassertion 5y agoIt's more complicated than that. A patent troll will hold a patent for X and then claim you are violating that patent. You, the holder of Y, can then say "well you're violating Y so fuck right off". Or maybe there's another patent that could potentially indicate prior art, but it isn't your patent. Or you're just a really small player with a few patents in your portfolio trying to defend against a troll. Companies pool their patents together, promising not to sue each other over patents, in order to collectively defend themselves against trolls.
- rrss 5y agothe world would be better if more companies were able or daring enough to fight bullshit patents directly (with prior art, obviousness, etc defenses). but instead every company chooses to defend themselves by deluging the patent office with more crap, and collective abuse of the patent system to patent stuff even the “inventor” thinks is obvious becomes accepted totally normal behavior.
- paxys 5y ago"The world would be a lot better if <very large group of people/companies> independently did xyz" can be applied to pretty much anything. Except tragedy of the commons is a real thing, and this is why you need governments to step in and regulate.
- deleted 5y ago[deleted]
- c-linkage 5y agoJust use the following code and you should be good! unsigned average(unsigned a, unsigned b) { return (a >> 1) + (b >> 1) + (a & b & 1); }