Logging to /Users/s/tmp/pari-16.04 GPRC Done. GP/PARI CALCULATOR Version 2.12.1 (development 25142-46eb34041) i386 running darwin (x86-64/GMP-6.2.0 kernel) 64-bit version compiled: Mar 22 2020, Apple clang version 11.0.0 (clang-1100.0.33.17) threading engine: single (readline v8.0 enabled, extended help enabled) Copyright (C) 2000-2020 The PARI Group PARI/GP is free software, covered by the GNU General Public License, and comes WITHOUT ANY WARRANTY WHATSOEVER. Type ? for help, \q to quit. Type ?17 for how to get moral (and possibly technical) support. parisizemax = 900001792, primelimit = 1000000 (17:31) gp > z=5+7*I %1 = 5 + 7*I (17:32) gp > z^2 %2 = -24 + 70*I (17:32) gp > abs(z) %3 = 8.6023252670426267717294735350497136320 (17:32) gp > abs(z^2) %4 = 74 (17:32) gp > factor(%) %5 = [ 2 1] [37 1] (17:32) gp > ?norm norm(x): norm of x. (17:32) gp > ??norm norm(x): Algebraic norm of x, i.e. the product of x with its conjugate (no square roots are taken), or conjugates for polmods. For vectors and matrices, the norm is taken componentwise and hence is not the L^2-norm (see norml2). Note that the norm of an element of R is its square, so as to be compatible with the complex norm. The library syntax is GEN gnorm(GEN x). (17:32) gp > norm(z) %6 = 74 (17:32) gp > w=2+3*I %7 = 2 + 3*I (17:33) gp > norm(w) %8 = 13 (17:33) gp > gcd(z,w) %9 = 1 (17:33) gp > lcm(z,w) %10 = -11 + 29*I (17:33) gp > norm(%) %11 = 962 (17:33) gp > factor(%) %12 = [ 2 1] [13 1] [37 1] (17:33) gp > Mod(z,w) *** at top-level: Mod(z,w) *** ^-------- *** Mod: forbidden division t_COMPLEX % t_COMPLEX. *** Break loop: type 'break' to go back to GP prompt break> break (17:34) gp > norm(z) %13 = 74 (17:34) gp > norm(z-w) %14 = 25 (17:34) gp > norm(z-w-w) %15 = 2 (17:34) gp > z-2*w %16 = 1 + I (17:34) gp > z %17 = 5 + 7*I (17:35) gp > Z=Mod(5+7*j,j^2+1) %18 = Mod(7*j + 5, j^2 + 1) (17:35) gp > w %19 = 2 + 3*I (17:35) gp > W=Mod(2+3*j,j^2+1) %20 = Mod(3*j + 2, j^2 + 1) (17:35) gp > gcd(Z,W) %21 = Mod(1, j^2 + 1) (17:35) gp > lcm(Z,W) %22 = Mod(29*j - 11, j^2 + 1) (17:35) gp > lift(%) %23 = 29*j - 11 (17:35) gp > norm(%) %24 = 841*j^2 - 638*j + 121 (17:35) gp > subst(%23,j,I) %25 = -11 + 29*I (17:36) gp > norm(%) %26 = 962 (17:36) gp > factor(%) %27 = [ 2 1] [13 1] [37 1] (17:36) gp > Mod(Z,W) *** at top-level: Mod(Z,W) *** ^-------- *** Mod: forbidden division t_POLMOD % t_POLMOD. *** Break loop: type 'break' to go back to GP prompt break> break (17:36) gp > Z %28 = Mod(7*j + 5, j^2 + 1) (17:36) gp > W %29 = Mod(3*j + 2, j^2 + 1) (17:36) gp > Mod(Z,3*j+5) %30 = Mod(0, 1) (17:36) gp > Mod(Z,7*j+5) %31 = Mod(0, 1) (17:36) gp > Mod(Z,3*j+w) %32 = Mod(0, 1) (17:37) gp > Mod(Z,3*j+2) %33 = Mod(0, 1) (17:37) gp > 7%5 %34 = 2 (17:47) gp > z %35 = 5 + 7*I (17:47) gp > w %36 = 2 + 3*I (17:47) gp > z%w *** at top-level: z%w *** ^-- *** _%_: forbidden division t_COMPLEX % t_COMPLEX. *** Break loop: type 'break' to go back to GP prompt break> break (17:47) gp > "Exercício - escrever uma função de divisão euclideano dos inteiros de Gauss" %37 = "Exercício - escrever uma função de divisão euclideano dos inteiros de Gauss" (17:48) gp > z/w %38 = 31/13 - 1/13*I (17:48) gp > floor(%) *** at top-level: floor(%) *** ^-------- *** floor: incorrect type in gfloor (t_COMPLEX). *** Break loop: type 'break' to go back to GP prompt break> break (17:48) gp > frac(%38) *** at top-level: frac(%38) *** ^--------- *** frac: incorrect type in gfloor (t_COMPLEX). *** Break loop: type 'break' to go back to GP prompt break> break (17:48) gp > gfrac(z)=frac(re(z))+I(frac(im(z)) *** syntax error, unexpected $end, expecting )-> or ',' or ')': *** ...=frac(re(z))+I(frac(im(z)) *** ^- (17:49) gp > ?real real(x): real part of x. (17:49) gp > ?imag imag(x): imaginary part of x. (17:49) gp > gfrac(z)=frac(real(z))+I*(frac(imag(z)) *** syntax error, unexpected $end, expecting )-> or ',' or ')': *** ...(real(z))+I*(frac(imag(z)) *** ^- (17:49) gp > gfrac(u)=frac(real(u))+I*(frac(imag(u)) *** syntax error, unexpected $end, expecting )-> or ',' or ')': *** ...(real(u))+I*(frac(imag(u)) *** ^- (17:49) gp > ?gfrac gfrac: unknown identifier (17:49) gp > ?u u: unknown identifier (17:50) gp > gfrac(u)=frac(real(u))+frac(imag(u))*I %39 = (u)->frac(real(u))+frac(imag(u))*I (17:50) gp > gfrac(z/w) %40 = 5/13 + 12/13*I (17:50) gp > z/w-gfrac(z/w) %41 = 2 - I (17:50) gp > %*w %42 = 7 + 4*I (17:50) gp > z-% %43 = -2 + 3*I (17:50) gp > norm(%) %44 = 13 (17:50) gp > norm(w) %45 = 13