Sha256: 21b50d7c0437d7bd877af8cb17c20727afdfe1288107e2628883fde61afc605a

Contents?: true

Size: 514 Bytes

Versions: 10

Compression:

Stored size: 514 Bytes

Contents

(DEFUN INTEGER-ARITHMETIC ()
    (DISPLAY "Enter two integers separated by a space.")
    (NEWLINE)
    (DISPLAY "> ")
    (DEFINE A (READ))
    (DEFINE B (READ))
    (DISPLAY `(SUM ,(+ A B)))
    (NEWLINE)
    (DISPLAY `(DIFFERENCE ,(- A B)))
    (NEWLINE)
    (DISPLAY `(PRODUCT ,(* A B)))
    (NEWLINE)
    (DISPLAY `(QUOTIENT ,(QUOTIENT A B))) ; truncates towards zero
    (NEWLINE)
    (DISPLAY `(REMAINDER ,(REM A B))) ; takes sign of first operand
    (NEWLINE)
    (DISPLAY `(EXPONENTIATION ,(EXPT A B))))

Version data entries

10 entries across 7 versions & 1 rubygems

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