Example #1
0
    def readFloat32(self):
        """
        Read 32-bits from the stream as a float value encoded according to IEEE 754 binary32.

        :returns: Read float value.
        :raises PythonRuntimeException: If the reading goes behind the stream.
        """

        return convertUInt32ToFloat(self.readBits(32))
Example #2
0
 def testConvertUInt32ToFloat(self):
     for dataRow in self.TEST_FLOAT32_DATA:
         float32Value = self._createFloat32Value(dataRow[0], dataRow[1],
                                                 dataRow[2])
         convertedFloat = convertUInt32ToFloat(float32Value)
         self.assertEqual(dataRow[3], convertedFloat)