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

view this post on Zulip Notification Bot (Nov 12 2021 at 21:04):

Peter Goodall has marked this topic as resolved.


Last updated: Nov 06 2024 at 04:40 UTC