How do I obtain the modulo of a vector in Julia.
There are two ways in Julia to perform a modulo:
mod(9,5)
or equivalently:
9 % 5
However, neither works with a vector.
This also the came for computing the remainder of a vector.
How do I obtain the modulo of a vector in Julia.
There are two ways in Julia to perform a modulo:
mod(9,5)
or equivalently:
9 % 5
However, neither works with a vector.
This also the came for computing the remainder of a vector.
Copyright © 2021 Jogjafile Inc.
For this you use the element-wise modulus operator
.%:Which gives:
EDIT: equivalently, you can use
mod.()