The % operator is shorthand rem, which computes the remainder; the sign of
the result matches the first argument. The mod function also exists, which
computes the modulus, the result of which matches its second argument.

On Fri, Dec 25, 2015 at 12:19 PM, Pranit Bauva <[email protected]>
wrote:

> Hey everyone!
>
> Julia's way of handling negative values in % seem to be different.
> julia> 7 % -3
> 1
>
> julia> -7 % 3
> -1
>
> julia> -7 % -3
> -1
>
> julia>
>
>
> Is this a bug or a feature?
>
> Regards,
> Pranit Bauva
>

Reply via email to