Skip to main content
abhisheks8539
August 23, 2023
Question

Bitwise And

  • August 23, 2023
  • 6 replies
  • 0 views

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
August 23, 2023

rule inputs are text. i.e.: 10011

mathieud0001
Brainy
August 23, 2023

What's the question?

abhisheks8539
August 23, 2023

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

mathieud0001
Brainy
August 23, 2023

This forum meant for asking questions.

August 23, 2023

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

anmolv0003
Participating Frequently
August 23, 2023

Anmol