Anonymous user
Arithmetic/Complex: Difference between revisions
Add Racket entry
(Add XPL0) |
(Add Racket entry) |
||
Line 2,538:
print(Re(z1)) # 1.5
print(Im(z1)) # 3</lang>
=={{header|Racket}}==
<lang lisp>
#lang racket
(define a 3+4i)
(define b 8+0i)
(+ a b) ; addition
(- a b) ; subtraction
(/ a b) ; division
(* a b) ; multiplication
(- a) ; negation
(/ 1 a) ; reciprocal
(conjugate a) ; conjugation
</lang>
=={{header|REXX}}==
|