September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
14
Task/Arithmetic-Integer/Ol/arithmetic-integer-1.ol
Normal file
14
Task/Arithmetic-Integer/Ol/arithmetic-integer-1.ol
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
(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)
|
||||
|
||||
(import (owl math-extra))
|
||||
(print "(expt " a " " b ") => " (expt a b))
|
||||
5
Task/Arithmetic-Integer/Ol/arithmetic-integer-2.ol
Normal file
5
Task/Arithmetic-Integer/Ol/arithmetic-integer-2.ol
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
; you can use more than two arguments for +,-,*,/ functions
|
||||
(print (+ 1 3 5 7 9)) ; ==> 25
|
||||
(print (- 1 3 5 7 9)) ; ==> -23
|
||||
(print (* 1 3 5 7 9)) ; ==> 945 - same as (1*3*5*7*9)
|
||||
(print (/ 1 3 5 7 9)) ; ==> 1/945 - same as (((1/3)/5)/7)/9
|
||||
Loading…
Add table
Add a link
Reference in a new issue