ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/Win32/libWin32/Win32/UI/IEEE754FloatConverter.cs
(Generate patch)

Comparing trunk/Win32/libWin32/Win32/UI/IEEE754FloatConverter.cs (file contents):
Revision 367 by william, Wed May 9 20:52:20 2012 UTC vs.
Revision 368 by william, Sun Jun 10 04:03:24 2012 UTC

# Line 22 | Line 22 | namespace System.Windows.Forms
22  
23          private void btnConvertToFloat_Click(object sender, EventArgs e)
24          {
25 +            CalculateFloat();
26 +        }
27 +
28 +        private void btnConvertToIEEE754Float_Click(object sender, EventArgs e)
29 +        {
30 +            CalculateHexFloat();
31 +        }
32 +
33 +        public void SetFloatHexValue(uint value)
34 +        {
35 +            txtIEEE754Float.Value = value;
36 +        }
37 +        public uint GetFloatHexValue()
38 +        {
39 +            return (uint)txtIEEE754Float.Value;
40 +        }
41 +        public void SetFloatValue(float value)
42 +        {
43 +            txtFloat.Value = value.ToString();
44 +        }
45 +        public float GetFloatValue()
46 +        {
47 +            return Convert.ToSingle(txtFloat.Value);
48 +        }
49 +        public void CalculateFloat()
50 +        {
51              ieee754FloatingPointConverter converter = new ieee754FloatingPointConverter();
52              converter.HexFloat = txtIEEE754Float.ToUInt32();
53              txtFloat.Text = string.Format("{0:R}", converter.Float);
54          }
55 <
30 <        private void btnConvertToIEEE754Float_Click(object sender, EventArgs e)
55 >        public void CalculateHexFloat()
56          {
57              ieee754FloatingPointConverter converter = new ieee754FloatingPointConverter();
58              float f;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines