Skip to main content
abhisheks8539
New Participant
Aug 23, 2023 6:31 AM UTC
Question

Bitwise And

a!localVariables(
  local!input1: if(
    len(ri!input2) > len(ri!input1),
    concat(
      a!forEach(
        items: enumerate(len(ri!input2) - len(ri!input1)),
        expression: 0
      ),
      ri!input1
    ),
    ri!input1
  ),
  local!input2: if(
    len(ri!input1) > len(ri!input2),
    concat(
      a!forEach(
        items: enumerate(len(ri!input1) - len(ri!input2)),
        expression: 0
      ),
      ri!input2
    ),
    ri!input2
  ),
  concat(
    a!forEach(
      items: enumerate(len(local!input1)),
      expression: if(
        and(local!input1[fv!index] =1, local!input2[fv!index]=1),
        1,
        0
      )
    )
  )
)

6 replies

abhisheks8539
New Participant
Aug 23, 2023 6:34 AM UTC

rule inputs are text. i.e.: 10011

mathieud0001
Genius
Aug 23, 2023 7:14 AM UTC

What's the question?

abhisheks8539
New Participant
Aug 23, 2023 9:49 AM UTC

no question just wanted to post that how i implemented bitwise and operator

mathieud0001
Genius
Aug 23, 2023 10:07 AM UTC

This forum meant for asking questions.

Participating Frequently
Aug 23, 2023 9:21 AM UTC

Hello abhishek, can you please mention the question and the expected result clearly?

anmolv0003
Participating Frequently
Aug 23, 2023 10:00 AM UTC

Anmol