[squeak-dev] The Inbox: Kernel-wiz.592.mcz

commits at source.squeak.org commits at source.squeak.org
Sun May 29 22:32:37 UTC 2011


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

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

Name: Kernel-wiz.592
Author: wiz
Time: 29 May 2011, 6:40:45.398 pm
UUID: ce3c0c86-e4f2-4bf5-8c2a-efbc708af821
Ancestors: Kernel-wiz.591

asNonFraction with updated comments.

ceiling speed up for positive numbers by mirroring floor code rathar than calling floor.

=============== Diff against Kernel-wiz.591 ===============

Item was changed:
  ----- Method: Fraction>>asNonFraction (in category 'converting') -----
  asNonFraction	
+ 	"Answer a number equivalent to the receiver that is not a fraction."
- 	"Answer the receiver asFloat. This is here for the benifit of the copyBits primitive which can handle floats but not fractions. It has to be stated this way so we don't turn integers into floats.  See inheritance for backstop"
  
+ 
  	^self asFloat!

Item was changed:
  ----- Method: Number>>asNonFraction (in category 'converting') -----
  asNonFraction	
+ 	"Answer a number equivalent to the receiver that is not a fraction. See Fraction for active method."
- 	"Answer the receiver. This is here for the benifit of the copyBits primitive which can handle floats but not fractions. It has to be stated this way so we don't turn integers into floats.  See Fraction for active method"
  
  	^self !

Item was changed:
  ----- Method: Number>>ceiling (in category 'truncation and round off') -----
  ceiling
+ 	"Answer the integer nearest the receiver toward  infinity."
- 	"Answer the integer nearest the receiver toward positive infinity."
  
+ 	| truncation |
+ 	truncation := self truncated.
+ 	self <= 0 ifTrue: [^truncation].
+ 	self = truncation
+ 		ifTrue: [^truncation]
+ 		ifFalse: [^truncation + 1]!
- 	self <= 0.0
- 		ifTrue: [^self truncated]
- 		ifFalse: [^self negated floor negated]!




More information about the Squeak-dev mailing list