equal
deleted
inserted
replaced
|
1 "{ Encoding: utf8 }" |
|
2 |
1 " |
3 " |
2 This is a Manchester Goodie. It is distributed freely on condition |
4 This is a Manchester Goodie. It is distributed freely on condition |
3 that you observe these conditions in respect of the whole Goodie, and on |
5 that you observe these conditions in respect of the whole Goodie, and on |
4 any significant part of it which is separately transmitted or stored: |
6 any significant part of it which is separately transmitted or stored: |
5 * You must ensure that every copy includes this notice, and that |
7 * You must ensure that every copy includes this notice, and that |
16 This is an additional goody-class, which is NOT covered by the |
18 This is an additional goody-class, which is NOT covered by the |
17 ST/X license. It has been packaged with the ST/X distribution to |
19 ST/X license. It has been packaged with the ST/X distribution to |
18 make your live easier instead. NO WARRANTY. |
20 make your live easier instead. NO WARRANTY. |
19 " |
21 " |
20 "{ Package: 'stx:libbasic' }" |
22 "{ Package: 'stx:libbasic' }" |
|
23 |
|
24 "{ NameSpace: Smalltalk }" |
21 |
25 |
22 ArithmeticValue subclass:#Complex |
26 ArithmeticValue subclass:#Complex |
23 instanceVariableNames:'real imaginary' |
27 instanceVariableNames:'real imaginary' |
24 classVariableNames:'ComplexOne ComplexZero' |
28 classVariableNames:'ComplexOne ComplexZero' |
25 poolDictionaries:'' |
29 poolDictionaries:'' |
343 ! ! |
347 ! ! |
344 |
348 |
345 !Complex methodsFor:'coercing'! |
349 !Complex methodsFor:'coercing'! |
346 |
350 |
347 coerce: aNumber |
351 coerce: aNumber |
|
352 "convert the argument aNumber into an instance of the receiver's class and return it." |
|
353 |
348 ^ aNumber asComplex |
354 ^ aNumber asComplex |
349 ! |
355 ! |
350 |
356 |
351 generality |
357 generality |
352 ^ 150 |
358 ^ 150 |
766 ! ! |
772 ! ! |
767 |
773 |
768 !Complex class methodsFor:'documentation'! |
774 !Complex class methodsFor:'documentation'! |
769 |
775 |
770 version |
776 version |
771 ^ '$Header: /cvs/stx/stx/libbasic/Complex.st,v 1.16 2014-07-10 12:23:25 cg Exp $' |
777 ^ '$Header$' |
772 ! ! |
778 ! ! |
773 |
779 |