The Trunk: Kernel-ct.1270.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Kernel-ct.1270.mcz

commits-2
Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ct.1270.mcz

==================== Summary ====================

Name: Kernel-ct.1270
Author: ct
Time: 20 September 2019, 8:08:13.335726 pm
UUID: 52e94fc9-2445-7a42-8ec8-12542fa2e549
Ancestors: Kernel-mt.1269

Add some printing functions for Complex

Not yet an equal concept to that one in Number, but still better than nothing :)

Try this: Float pi i exp stringForReadout

=============== Diff against Kernel-mt.1269 ===============

Item was added:
+ ----- Method: Complex>>printOn:showingDecimalPlaces: (in category 'printing') -----
+ printOn: aStream showingDecimalPlaces: placesDesired
+ real printOn: aStream showingDecimalPlaces: placesDesired.
+ aStream nextPut: Character space.
+ 0 <= imaginary
+ ifTrue: [aStream nextPut: $+]
+ ifFalse: [aStream nextPut: $-].
+ aStream nextPut: Character space.
+ imaginary abs printOn: aStream showingDecimalPlaces: placesDesired.
+ aStream nextPut: Character space.
+ aStream nextPut: $i
+ !

Item was added:
+ ----- Method: Complex>>stringForReadout (in category 'printing') -----
+ stringForReadout
+
+ ^ String streamContents: [:stream |
+ self printOn: stream showingDecimalPlaces: 0]!