On 13 Nov., 22:48, Robert Kern <[EMAIL PROTECTED]> wrote:
> Slaunger wrote:
> > It is always good to ask yourself a question.
> > I had forgooten about the reduce function
>
> > I guess this implementation
>
> > from numpy import *
>
> > def compl_add_uint16(a, b):
> > c = a + b
> > c += c
Slaunger wrote:
It is always good to ask yourself a question.
I had forgooten about the reduce function
I guess this implementation
from numpy import *
def compl_add_uint16(a, b):
c = a + b
c += c >> 16
return c & 0x
def compl_one_checksum(uint16s):
return reduce(compl_add
It is always good to ask yourself a question.
I had forgooten about the reduce function
I guess this implementation
from numpy import *
def compl_add_uint16(a, b):
c = a + b
c += c >> 16
return c & 0x
def compl_one_checksum(uint16s):
return reduce(compl_add_uint16, uint16s,