[squeak-dev] The Trunk: Collections-eem.960.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Oct 1 21:42:32 UTC 2021

Eliot Miranda uploaded a new version of Collections to project The Trunk:

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

Name: Collections-eem.960
Author: eem
Time: 1 October 2021, 2:42:29.723067 pm
UUID: 5f8b030a-f7a8-4f5f-8316-a16f87d86a34
Ancestors: Collections-ul.959

Make sure ByteArray>>doubleAt:bigEndian: answers SmallFloat64's if possible.

=============== Diff against Collections-ul.959 ===============

Item was changed:
  ----- Method: ByteArray>>doubleAt:bigEndian: (in category 'platform independent access') -----
  doubleAt: index bigEndian: bool 
  	"Return a 64 bit float starting from the given byte index"
  	| w1 w2 dbl |
  	w1 := self unsignedLongAt: index bigEndian: bool.
  	w2 := self unsignedLongAt: index + 4 bigEndian: bool.
  	dbl := Float new: 2. 
  		ifTrue: [dbl basicAt: 1 put: w1.
  			dbl basicAt: 2 put: w2]
  		ifFalse: [dbl basicAt: 1 put: w2.
  			dbl basicAt: 2 put: w1].
+ 	^dbl * 1.0 "reduce to SmallFloat64 if possible"!
- 	^ dbl!

More information about the Squeak-dev mailing list