Re: How to determine Mod(a,b) with t_COMPLEX b?

[email protected]
Newsgroups gmane.comp.mathematics.pari.user
Message-ID <[email protected]>
On 2025-05-27 18:27, [email protected] wrote:
>> 
> I found the reason for no difference — real(b) and imag(b) were 
> relative prime.
> If not relative prime, there are differences:
> 
> ? b*=2
> 6 + 4*I
> ? S=Set([a - round(a/b)*b |
> r<-[-real(b)..real(b)];i<-[-imag(b)..imag(b)];a<-[r+i*I]]);
> ? myS=Set([a - myround(a/b)*b |
> r<-[-real(b)..real(b)];i<-[-imag(b)..imag(b)];a<-[r+i*I]]);
> ? #S==norml2(b)&&#myS==norml2(b)
> 1
> ? setminus(S,myS)
> [-3 - 2*I, -1 - 5*I, 2 - 3*I]
> ? setminus(myS,S)
> [-2 + 3*I, 1 + 5*I, 3 + 2*I]
> ?
> 
Last, but not least, a picture:

? b
6 + 4*I
? imi=vecmin([imag(s)|s<-S]);
? ima=vecmax([imag(s)|s<-S]);
? rmi=vecmin([real(s)|s<-S]);
? rma=vecmax([real(s)|s<-S]);
? M=matrix(ima-imi+1,rma-rmi+1);
? foreach(S,s,M[imag(s)-imi+1,real(s)-rmi+1]=1)
? foreach(M~,m,foreach(m,e,print1(if(e,"x"," ")));print())
    x
    xx
   xxxxx
  xxxxxxx
  xxxxxxxx
xxxxxxxxx
xxxxxxxx
  xxxxxx
    xxxx
     xx
?


Regards,

Hermann.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.