Sha256: be3d559e61a60b874055f1d0b01a937e4dc6bd44e29df993b5ae39486383c0ce

Contents?: true

Size: 717 Bytes

Versions: 10

Compression:

Stored size: 717 Bytes

Contents

The remainder returned by mod is non-negative. Furthermore, <code>div$(!a.!d)*!d+mod$(!a.!d):!a</code> for all integer <code>!a</code> and <code>!d</code>, <code>!d:~0</code>.
  ( enter
  =     put$"Enter two integer numbers, separated by space:"
      &amp; get':(~/#?k_~/#?m|quit:?k)
    |     out
        $ "You must enter two integer numbers! Enter \"quit\" if you don't know how to do that."
      &amp; !enter
  )
&amp; !enter
&amp; !k:~quit
&amp; out$("You entered" !k and !m ". Now look:")
&amp; out$("Sum:" !k+!m)
&amp; out$("Difference:" !k+-1*!m)
&amp; out$("Product:" !k*!m)
&amp; out$("Integer division:" div$(!k.!m))
&amp; out$("Remainder:" mod$(!k.!m))
&amp; out$("Exponentiation:" !k^!m)
&amp; done;

Version data entries

10 entries across 7 versions & 1 rubygems

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