public void TestRandomFixedFloatRoundTripSerialization()
        {
            var r = new Random();

            for (int n = 0; n < 1000; ++n)
            {

                var f = (float)((r.NextDouble() * 2) - 1);

                for (var i = 0; i < 2; ++i)
                {
                    var bw = new BitWriter(32);
                    bw.WriteFixedCompressedFloat(f, 1, 16);
                    var br = new BitReader(bw.GetBits(0, bw.Length).ToArray());
                    var f2 = br.ReadFixedCompressedFloat(1, 16);

                    if (i == 0)
                    {
                        // We're generating floats that are probably going to lose precision when serialized.
                        // So the first time around just check to see if we're close.
                        Assert.IsTrue(Math.Abs(f - f2) < 0.0001);
                    }
                    else
                    {
                        Assert.AreEqual(f, f2);
                    }
                    Assert.AreEqual(bw.Length, br.Position);
                    f = f2;
                }
            }
        }