Anonymous user
Arithmetic/Complex: Difference between revisions
→{{header|Smalltalk}}
(→{{header|Smalltalk}}: more examples involving fractions) |
|||
Line 4,491:
a negated displayNl.</lang>
{{works with|Smalltalk/X}}
Complex is already in the basic class library. Multiples of imaginary are created by sending an "i" message to a number, which can be added to another number. Thus 5i => (0+5i), 1+(1/3)I => (1+1/3i) and (1.0+2i) => (1.0+2i). Notice that the
<lang smalltalk>
|a b|
|