JuliaLang/julia

mod(::Complex{<:Integer}, ::Integer) and div etc.

Open

#37,376 opened on Sep 3, 2020

View on GitHub
 (18 comments) (3 reactions) (0 assignees)Julia (5,773 forks)batch import
complexgood first issue

Repository metrics

Stars
 (48,709 stars)
PR merge metrics
 (Avg merge 20d 6h) (157 merged PRs in 30d)

Description

As discussed on discourse, this seems like the only sensible definition:

mod(z::Complex{<:Integer}, n::Integer) = Complex(mod(real(z), n), mod(imag(z), n))

and similarly for div, rem (and probably divrem).

Should be easy to create a patch (much simpler than #35374): just add the 1-line definitions analogous to the one above, docs, news, and a test.

Contributor guide