[Pkg] The Trunk: Kernel-nice.860.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jul 24 11:01:55 UTC 2014


Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.860.mcz

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

Name: Kernel-nice.860
Author: nice
Time: 24 July 2014, 1:00:22.683 pm
UUID: 368a9aba-7c65-ad4b-9499-75a652bed57f
Ancestors: Kernel-eem.859

Avoid engaging LargeInteger arithmetic (asTrueFraction) just for testing the sign of a Float

=============== Diff against Kernel-eem.859 ===============

Item was changed:
  ----- Method: Float>>sign (in category 'mathematical functions') -----
  sign
  	"Answer 1 if the receiver is greater than 0, -1 if less than 0, else 0.
  	Handle IEEE-754 negative-zero by reporting a sign of -1"
  
+ 	self > 0.0 ifTrue: [^ 1].
+ 	(self < 0.0 or: [((self at: 1) bitShift: -31) = 1]) ifTrue: [^ -1].
- 	self > 0 ifTrue: [^ 1].
- 	(self < 0 or: [((self at: 1) bitShift: -31) = 1]) ifTrue: [^ -1].
  	^ 0!



More information about the Packages mailing list