Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
21
Task/Arithmetic-Integer/Ol/arithmetic-integer.ol
Normal file
21
Task/Arithmetic-Integer/Ol/arithmetic-integer.ol
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
(define a 8)
|
||||
(define b 12)
|
||||
|
||||
(print "(+ " a " " b ") => " (+ a b))
|
||||
(print "(- " a " " b ") => " (- a b))
|
||||
(print "(* " a " " b ") => " (* a b))
|
||||
(print "(/ " a " " b ") => " (/ a b))
|
||||
|
||||
(print "(quotient " a " " b ") => " (quot a b)) ; same as (quotient a b)
|
||||
(print "(remainder " a " " b ") => " (rem a b)) ; same as (remainder a b)
|
||||
(print "(modulo " a " " b ") => " (mod a b)) ; same as (modulo a b)
|
||||
|
||||
(print "(expt " a " " b ") => " (expt a b))
|
||||
(print "(gcd " a " " b ") => " (gcd a b))
|
||||
(print "(lcm " a " " b ") => " (lcm a b))
|
||||
|
||||
; you can use more than two arguments for +,-,*,/ functions
|
||||
(print (+ 1 3 5 7 9))
|
||||
(print (- 1 3 5 7 9))
|
||||
(print (* 1 3 5 7 9)) ; same as (1*3*5*7*9)
|
||||
(print (/ 1 3 5 7 9)) ; same as (((1/3)/5)/7)/9
|
||||
Loading…
Add table
Add a link
Reference in a new issue