Re: Bit Operations

2007-11-28 Thread John Machin
On Nov 29, 9:20 am, "Gianmaria Iaculo - NVENTA" <[EMAIL PROTECTED]> wrote: > John can you make an example of this solution? Which possible solution? (a) 32-bit floating point (b) 32-bit integer (c) packed decimal > You maen that a more compact > way is possible??? More compact than what? If your

Re: Bit Operations

2007-11-28 Thread Gianmaria Iaculo - NVENTA
John can you make an example of this solution? You maen that a more compact way is possible??? Firma Gianmaria Iaculo "John Machin" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > On Nov 29, 8:05 am, "Gianmaria Iaculo - NVENTA" > <[EMAIL PROTECTED]> wrote: >> Txs all, >> i

Re: Bit Operations

2007-11-28 Thread John Machin
On Nov 29, 8:35 am, "Gianmaria Iaculo - NVENTA" <[EMAIL PROTECTED]> wrote: > U are really nice guys... i'm really apreciating (sorry 4 my bad english) > > Chriss is right this are coordinates and i'm treating as strings > naturally > I dont really have floating points on my module.. it run a 1.

Re: Bit Operations

2007-11-28 Thread John Machin
On Nov 29, 8:05 am, "Gianmaria Iaculo - NVENTA" <[EMAIL PROTECTED]> wrote: > Txs all, > i wont to respond to who asked why i needed it: > > I'm using python on GSM modules and the informations i have to move goes > along GPRS/UMTS connections so it's beatiful for me to transfer more > informations

Re: Bit Operations

2007-11-28 Thread Tim Chase
>> >>> 0xff & (((0xff & a) << 4) | (0xff & b)) >> 150 >> >> or, if you're sloppy, >> >> >>> (a << 4) | b >> 150 > > Slightly OT, maybe - why exactly is the second alternative 'sloppy?' > I believe you, because I had a problem once (in Java) with bytes not > having the value I expected unless I d

Re: Bit Operations

2007-11-28 Thread Gianmaria Iaculo - NVENTA
M, J. Clifford Dyer <[EMAIL PROTECTED]> wrote: >> On Wed, Nov 28, 2007 at 10:05:40PM +0100, Gianmaria Iaculo - NVENTA wrote >> regarding Re: Bit Operations: >> > >> > Txs all, >> > i wont to respond to who asked why i needed it: >> > >>

Re: Bit Operations

2007-11-28 Thread Chris Mellon
On Nov 28, 2007 3:18 PM, J. Clifford Dyer <[EMAIL PROTECTED]> wrote: > On Wed, Nov 28, 2007 at 10:05:40PM +0100, Gianmaria Iaculo - NVENTA wrote > regarding Re: Bit Operations: > > > > Txs all, > > i wont to respond to who asked why i needed it: > > > &g

Re: Bit Operations

2007-11-28 Thread J. Clifford Dyer
On Wed, Nov 28, 2007 at 10:05:40PM +0100, Gianmaria Iaculo - NVENTA wrote regarding Re: Bit Operations: > > Txs all, > i wont to respond to who asked why i needed it: > > I'm using python on GSM modules and the informations i have to move goes > along GPRS/UMTS connectio

Re: Bit Operations

2007-11-28 Thread Gianmaria Iaculo - NVENTA
Txs all, i wont to respond to who asked why i needed it: I'm using python on GSM modules and the informations i have to move goes along GPRS/UMTS connections so it's beatiful for me to transfer more informations with less space... imagine i have to send this simple data 41.232323,12.345678

Re: Bit Operations

2007-11-28 Thread Dan Upton
> >>> 0xff & (((0xff & a) << 4) | (0xff & b)) > 150 > > or, if you're sloppy, > > >>> (a << 4) | b > 150 Slightly OT, maybe - why exactly is the second alternative 'sloppy?' I believe you, because I had a problem once (in Java) with bytes not having the value I expected unless I did the and-magi

Re: Bit Operations

2007-11-28 Thread J. Clifford Dyer
On Wed, Nov 28, 2007 at 09:07:56PM +0100, Gianmaria Iaculo - NVENTA wrote regarding Bit Operations: > > Hi there, > I'm so new to python (coming from .net so excuse me for the stupid question) > and i'm tring to do a very simple thing,with bytes. > > My problem is

Re: Bit Operations

2007-11-28 Thread Grant Edwards
On 2007-11-28, Chris Mellon <[EMAIL PROTECTED]> wrote: > On Nov 28, 2007 2:07 PM, Gianmaria Iaculo - NVENTA ><[EMAIL PROTECTED]> wrote: >> Hi there, >> I'm so new to python (coming from .net so excuse me for the stupid question) >> and i'm tring to do a very simple thing,with bytes. >> >> My proble

Re: Bit Operations

2007-11-28 Thread John Machin
On Nov 29, 7:07 am, "Gianmaria Iaculo - NVENTA" <[EMAIL PROTECTED]> wrote: > Hi there, > I'm so new to python (coming from .net so excuse me for the stupid question) > and i'm tring to do a very simple thing,with bytes. > > My problem is this: > > i've a byte that naturally is composed from 2 nibbl

Re: Bit Operations

2007-11-28 Thread Chris Mellon
On Nov 28, 2007 2:27 PM, Chris Mellon <[EMAIL PROTECTED]> wrote: > On Nov 28, 2007 2:07 PM, Gianmaria Iaculo - NVENTA > <[EMAIL PROTECTED]> wrote: > > Hi there, > > I'm so new to python (coming from .net so excuse me for the stupid question) > > and i'm tring to do a very simple thing,with bytes. >

Re: Bit Operations

2007-11-28 Thread Chris Mellon
On Nov 28, 2007 2:07 PM, Gianmaria Iaculo - NVENTA <[EMAIL PROTECTED]> wrote: > Hi there, > I'm so new to python (coming from .net so excuse me for the stupid question) > and i'm tring to do a very simple thing,with bytes. > > My problem is this: > > i've a byte that naturally is composed from 2 ni

Re: Bit Operations

2007-11-28 Thread Tim Chase
> I'm really confused on how t do it, maybe cause python is > type-less (dynamic typed) Being duck-typed doesn't really have anything to do with it. Python supports logical shifting and combining > i've a byte that naturally is composed from 2 nibbles hi&low, > and two chars.. like A nd B. What

Bit Operations

2007-11-28 Thread Gianmaria Iaculo - NVENTA
Hi there, I'm so new to python (coming from .net so excuse me for the stupid question) and i'm tring to do a very simple thing,with bytes. My problem is this: i've a byte that naturally is composed from 2 nibbles hi&low, and two chars.. like A nd B. What i wonna do is to write A to the High nib