24 lines
918 B
Smalltalk
24 lines
918 B
Smalltalk
|a b|
|
|
a := 1 + 1i.
|
|
b := 3.14159 + 1.2i.
|
|
Transcript show:'a => '; showCR:a.
|
|
Transcript show:'b => '; showCR:b.
|
|
Transcript show:'a+b => '; showCR:(a + b).
|
|
Transcript show:'a-b => '; showCR:(a - b).
|
|
Transcript show:'a*b => '; showCR:(a * b).
|
|
Transcript show:'a/b => '; showCR:(a / b).
|
|
Transcript show:'a reciprocal => '; showCR:a reciprocal.
|
|
Transcript show:'a conjugated => '; showCR:a conjugated.
|
|
Transcript show:'a abs => '; showCR:a abs.
|
|
Transcript show:'a real => '; showCR:a real.
|
|
Transcript show:'a imaginary => '; showCR:a imaginary.
|
|
Transcript show:'a negated => '; showCR:a negated.
|
|
Transcript show:'a sqrt => '; showCR:a sqrt.
|
|
a2 := (1/2) + 1i.
|
|
b2 := (2/3) + 2i.
|
|
Transcript show:'a2+b2 => '; showCR:(a2 + b2).
|
|
Transcript show:'a2-b2 => '; showCR:(a2 - b2).
|
|
Transcript show:'a2*b2 => '; showCR:(a2 * b2).
|
|
Transcript show:'a2/b2 => '; showCR:(a2 / b2).
|
|
Transcript show:'a2 reciprocal => '; showCR:a2 reciprocal.
|