[squeak-dev] The Inbox: Kernel-mtf.924.mcz

commits at source.squeak.org commits at source.squeak.org
Sat May 2 16:27:53 UTC 2015


A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-mtf.924.mcz

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

Name: Kernel-mtf.924
Author: mtf
Time: 2 May 2015, 12:26:05.675 pm
UUID: 7f688860-5202-4c0d-8ece-8723fe7317d6
Ancestors: Kernel-nice.923

Copied Number >> #round: from Pharo. One of 3 methods needed to make the Artefact pdf library work on squeak: https://sites.google.com/site/artefactpdf/

=============== Diff against Kernel-nice.923 ===============

Item was added:
+ ----- Method: Float>>round: (in category 'truncation and round off') -----
+ round: numberOfWishedDecimal
+         "only leave a fixed amount of decimal"
+         "10.12345 round: 2 => 10.12"
+         
+         | v |
+         v := 10 raisedTo: numberOfWishedDecimal.
+         ^ ((self * v) rounded / v) asFloat
+ !

Item was added:
+ ----- Method: Fraction>>round: (in category 'truncation and round off') -----
+ round: numberOfWishedDecimal
+ 	^self asFloat round: numberOfWishedDecimal!

Item was added:
+ ----- Method: Integer>>round: (in category 'truncation and round off') -----
+ round: numberOfWishedDecimal
+ 	^self!

Item was added:
+ ----- Method: Number>>round: (in category 'truncation and round off') -----
+ round: numberOfWishedDecimal
+ 	self subclassResponsibility!



More information about the Squeak-dev mailing list