zettacode.files/arithmetic.integer/bracmat.txt in zettacode-0.1.0 vs zettacode.files/arithmetic.integer/bracmat.txt in zettacode-0.1.1
- old
+ new
@@ -1,19 +1,19 @@
-T u b -. Fu, c$(!.!)*!+$(!.!):!c f c!c c!c, c!:~0c.
- (
- = u$"E ub, b c:"
- ':(~#?_~#?|qu:?)
- | u
- $ "Yu u ub! E \"qu\" f u ' ."
- !
+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:"
+ & get':(~/#?k_~/#?m|quit:?k)
+ | out
+ $ "You must enter two integer numbers! Enter \"quit\" if you don't know how to do that."
+ & !enter
)
- !
- !:~qu
- u$("Yu " ! ! ". N :")
- u$("Su:" !+!)
- u$("Dffc:" !+-1*!)
- u$("Puc:" !*!)
- u$("I :" $(!.!))
- u$("R:" $(!.!))
- u$("E:" !^!)
-
+& !enter
+& !k:~quit
+& out$("You entered" !k and !m ". Now look:")
+& out$("Sum:" !k+!m)
+& out$("Difference:" !k+-1*!m)
+& out$("Product:" !k*!m)
+& out$("Integer division:" div$(!k.!m))
+& out$("Remainder:" mod$(!k.!m))
+& out$("Exponentiation:" !k^!m)
+& done;