USER-DEFINED TYPES AND AGGREGATES w.Write((byte)0xFF); } } else

USER-DEFINED TYPES AND AGGREGATES w.Write((byte)0xFF); } } else { Dim v; v.value = value; v.units = units; // normalize to inches if (v.units == ft ) { v.value *= 12; } if (v.units == yd ) { v.value *= 36; } v.units = in ; // serialize the approx log10 of value first // so you can squeeze it into a long // note that this order is only approximate UInt64 l10 = UInt64.MaxValue >> 1; // there is a bit of a dance here // to make sure that the negative and // small number come out in the // right order if (v.value != 0.0) { if (v.value > 0.0) { Int64 l = (Int64)(Math.Log10(v.value) * 29921268260570000.0); if (l >= 0) { // divide by 4 l10 = (UInt64)l >> 2; // add half of max l10 += (UInt64.MaxValue >>2) + (UInt64.MaxValue >>1); // result is in upper quarter of positive numbers } else { // divide by 2 l10 = (UInt64)(-l >> 2); l10 += (UInt64.MaxValue >>2); // result is in lower quarter of upper half of positive numbers } } else { Int64 l = (Int64)(Math.Log10(-v.value) * 29921268260570000.0); if (l >= 0)

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Tomcat Web Hosting services

Bookmark the permalink.

Comments are closed.