Sha256: 877b7f38596f6463529b71cfa132e089489b0b3e2505f2704692d230fcbe3efd

Contents?: true

Size: 384 Bytes

Versions: 10

Compression:

Stored size: 384 Bytes

Contents

Integer division with <code>\</code> rounds to <math>-\infty</math>. There also exists the <code>\/</code> round-to-nearest (ties to <math>+\infty</math>) operator.  Ordinary division <code>/</code> does not round but returns rationals if given integers with a non-integral quotient.
arith(a,b)={
  print(a+b);
  print(a-b);
  print(a*b);
  print(a\b);
  print(a%b);
  print(a^b);
};

Version data entries

10 entries across 7 versions & 1 rubygems

Version Path
zettacode-0.1.7 files.zettacode/arithmetic.integer/pari-gp.txt
zettacode-0.1.6 files.zettacode/arithmetic.integer/pari-gp.txt
zettacode-0.1.6 files.zettacode2/arithmetic.integer/pari-gp.txt
zettacode-0.1.5 files.zettacode/arithmetic.integer/pari-gp.txt
zettacode-0.1.5 files.zettacode2/arithmetic.integer/pari-gp.txt
zettacode-0.1.4 files.zettacode/arithmetic.integer/pari-gp.txt
zettacode-0.1.4 files.zettacode2/arithmetic.integer/pari-gp.txt
zettacode-0.1.3 files.zettacode/arithmetic.integer/pari-gp.txt
zettacode-0.1.2 files.zettacode/arithmetic.integer/pari-gp.txt
zettacode-0.1.1 zettacode.files/arithmetic.integer/pari-gp.txt