RE: not_bits() not_working()
- Posted by Al Getz <Xaxo at aol.com> Jun 27, 2003
- 427 views
Derek Parnell wrote: > > > ----- Original Message ----- > From: "Al Getz" <Xaxo at aol.com> > To: "EUforum" <EUforum at topica.com> > Subject: not_bits() not_working() > > > > Hello, > > > > I've found that Euphorias not_bits() function doesnt really work > > correctly. > > > > For example: > > > > atom a,x > > a=2 > > > > x=not_bits(a) > > > > --now x equals -3, which isnt correct. > > --x should be equal to the 8 digit hex equivalent of -3, > > --right? > > > > Sorry Al, but it does exactly what I'd expect it to do. Each bit in the > 32-bit value is reversed. If it didn't work this way a number of > functions > in win32lib would fail. > > -- > Derek > > Yes it is working, but didnt appear to be working because printf with the %d formatter prints it as a negative number sometimes, and when you use the %x formatter it prints as a regular hex number. Al