discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Operation of short to char


From: Monahan-Mitchell, Tim
Subject: Re: [Discuss-gnuradio] Operation of short to char
Date: Thu, 27 Jun 2013 19:13:28 +0000

Oh, like the lower 8 bits are like additional precision “digits” that are being truncated… I would not have expected that either. Comments in the GRC XML file would be good…

 

From: discuss-gnuradio-bounces+address@hidden [mailto:discuss-gnuradio-bounces+address@hidden On Behalf Of Nemanja Savic
Sent: Thursday, June 27, 2013 1:09 PM
To: Stephen Harrison; GNURadio Discussion List
Subject: Re: [Discuss-gnuradio] Operation of short to char

 

I think that I posted something similar few weeks ago. I also didn't expect that 0-255 short goes to 0 char, and spent like a day trying to figure out the bug, but at the end it is like that.

 

On Thu, Jun 27, 2013 at 8:34 PM, Stephen Harrison <address@hidden> wrote:

Hi,

 

Just wondering if the operation of short to char is a bug or intentional. The most significant 8 bits of the short gets converted to char, ie:

 

0-255 (short) -> 0 (char)

256-511 (short) -> 1 (char)

512-767 (short) -> 2 (char)

 

This is not the operation I expected, but the unit test allows it to work this way, so I am confused.

 

Regards,

 

Stephen


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio




--
Nemanja Savić


reply via email to

[Prev in Thread] Current Thread [Next in Thread]