Stream: helpdesk (published)

Topic: xor of BitVectors


view this post on Zulip Peter Goodall (Nov 12 2021 at 07:34):

Have I done something incorrectly? I was expecting this to work:

> using Random: bitrand
> x = bitrand(5); y = bitrand(5)
> xor(x,y)
ERROR: MethodError: no method matching xor(::BitVector, ::BitVector)
Closest candidates are:
  xor(::Any, ::Any, ::Any, ::Any...) at operators.jl:560
Stacktrace:
 [1] top-level scope
   @ REPL[14]:1

view this post on Zulip Sebastian Pfitzner (Nov 12 2021 at 08:13):

julia> xor.(x,y)
5-element BitVector:
 1
 0
 0
 1
 0

Last updated: Oct 02 2023 at 04:34 UTC