Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/Arithmetic-Complex/Ol/arithmetic-complex.ol
Normal file
23
Task/Arithmetic-Complex/Ol/arithmetic-complex.ol
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
(define A 0+1i) ; manually entered numbers
|
||||
(define B 1+0i)
|
||||
|
||||
(print (+ A B))
|
||||
; <== 1+i
|
||||
|
||||
(print (- A B))
|
||||
; <== -1+i
|
||||
|
||||
(print (* A B))
|
||||
; <== 0+i
|
||||
|
||||
(print (/ A B))
|
||||
; <== 0+i
|
||||
|
||||
|
||||
(define C (complex 2/7 -3)) ; functional way
|
||||
|
||||
(print "real part of " C " is " (car C))
|
||||
; <== real part of 2/7-3i is 2/7
|
||||
|
||||
(print "imaginary part of " C " is " (cdr C))
|
||||
; <== imaginary part of 2/7-3i is -3
|
||||
Loading…
Add table
Add a link
Reference in a new issue