[Numpy-discussion] Random Numbers

Perry Greenfield perry at stsci.edu
Wed Jun 2 08:35:08 CDT 2004


Karthikesh Raju wrote:
> 
> n_Errors = sum(not_equal(Tx_Bit_Stream,Rx_Bit_Stream))
> 
> Now i have noted that n_Errors is negative? How can that be so?
> 
> n_Errors should be the number of places where Tx_Bit_Stream differs from
> Rx_Bit_Stream? How can the sum be negative?
> 
> 
I'm guessing you are seeing overflow problems with the boolean 
representation which is the result of logical comparisons
(which uses only 8 bit values) try:

sum(float(not_equal...

to eliminate that problem.

Perry




More information about the Numpy-discussion mailing list