bitmask operations?

harri678
harri678 New Altair Community Member
edited November 5 in Community Q&A
Hi.

is there any way to use some kind of bitmask operations in the "generate attributes" operator? I have an integer with bits 2^0-4 used for bit information andI want to generate binominal attributes based on one bit's value...

Greetings,
Harald
Tagged:

Answers

  • land
    land New Altair Community Member
    Hi Harald,
    although there aren't any bit mask operations available directly, you can use the modulo operator for simulating them. To test if the first bit is set, just use the modulo 2 operation for the higher bit n use this forumlar:

    (x % 2^(n+1) - x % 2^n) / 2^n

    Greetings,
      Sebastian
  • harri678
    harri678 New Altair Community Member
    thanks!