'From Squeak3.7 of ''4 September 2004'' [latest update: #5989] on 3 December 2004 at 3:01:32 pm'! "Change Set: ByteArray-doubleAt Date: 3 December 2004 Author: Hans Baveco Adds methods to ByteArray to read and write 64 bit Floats (DOUBLES) from and to a ByteArray. For the reading methods credits go to Andreas Raab. I made up the writing method - that one needs to be checked!!!!!! "! !ByteArray methodsFor: 'platform independent access' stamp: 'jmb 12/3/2004 14:54'! 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. bool ifTrue: [dbl basicAt: 1 put: w1. dbl basicAt: 2 put: w2] ifFalse: [dbl basicAt: 1 put: w2. dbl basicAt: 2 put: w1]. ^ dbl! ! !ByteArray methodsFor: 'platform independent access' stamp: 'jmb 12/3/2004 14:54'! doubleAt: index put: value bigEndian: bool "Store a 64 bit float starting from the given byte index" | w1 w2 | bool ifTrue: [w1 _ value basicAt: 1. w2 _ value basicAt: 2] ifFalse: [w1 _ value basicAt: 2. w2 _ value basicAt: 1]. self unsignedLongAt: index put: w1 bigEndian: bool. self unsignedLongAt: index + 4 put: w2 bigEndian: bool. ^ value! !