liberty-eiffel
[Top][All Lists]
Advanced

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

Re: [Liberty-eiffel] Bitwise operations on integers


From: Raphael Mack
Subject: Re: [Liberty-eiffel] Bitwise operations on integers
Date: Wed, 13 Aug 2014 20:24:06 +0000
User-agent: Internet Messaging Program (IMP) H5 (6.2.1)

Zitat von Christian Rinderknecht <address@hidden>:
Dear members,

I wonder how to perform bitwise operations on integers. Using
BIT_STRING is too costly in memory for me, and BIT n is not available
anymore.

see the bitwise-features in INTEGER_GENERAL, e. g. bit_xor:

class XOR

create {}
   make

feature {}
   make
      local
         a: INTEGER
         b: INTEGER
      do
         a := 0xFF
         b := 0xAA
         a := a.bit_xor(b)
         io.put_string("A = " + a.out)
      end

end


For bitwise AND, OR and NOT even the well known pre/infix operators "& | and ~" are available.

Rapha




reply via email to

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