[julia-users] Re: binary string to hex

2015-12-04 Thread Martin Somers
ahh i see thanks going a = a $(0x1 << 6) reverts back then again I could just initialise it again to default :) tks guys M

[julia-users] Re: binary string to hex

2015-12-04 Thread Seth
you're binary-or'ing a bit with 0x0, which means you're not going to change it. There's some useful information here: https://en.wikipedia.org/wiki/Bit_manipulation On Friday, December 4, 2015 at 9:47:45 AM UTC-8, Martin Somers wrote: > > > > On Friday, 4 December 2015 16:36:34 UTC, James Gilb

[julia-users] Re: binary string to hex

2015-12-04 Thread Martin Somers
On Friday, 4 December 2015 16:36:34 UTC, James Gilbert wrote: > > I find bits(a) more useful than bin(a). It enables me to see all the bits > of an integer when experimenting with << and >> to see if I'm doing the > right thing. eg, set the 2nd bit of a byte: > > > *julia> **a = 0b0010* > >

[julia-users] Re: binary string to hex

2015-12-04 Thread James Gilbert
I find bits(a) more useful than bin(a). It enables me to see all the bits of an integer when experimenting with << and >> to see if I'm doing the right thing. eg, set the 2nd bit of a byte: *julia> **a = 0b0010* *0x02* *julia> **bits(a)* *"0010"* *julia> **a = a | (0x1 << 6)* *0x