/[RomCheater]/trunk/Win32/libWin32/Win32/UI/IEEE754FloatConverter.cs
ViewVC logotype

Diff of /trunk/Win32/libWin32/Win32/UI/IEEE754FloatConverter.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/Win32/libWin32/Win32/UI/IEEE754FloatConverter.cs	2012/06/10 03:39:00	367
+++ trunk/Win32/libWin32/Win32/UI/IEEE754FloatConverter.cs	2012/06/10 04:03:24	368
@@ -22,12 +22,37 @@
 
         private void btnConvertToFloat_Click(object sender, EventArgs e)
         {
+            CalculateFloat();
+        }
+
+        private void btnConvertToIEEE754Float_Click(object sender, EventArgs e)
+        {
+            CalculateHexFloat();
+        }
+
+        public void SetFloatHexValue(uint value)
+        {
+            txtIEEE754Float.Value = value;
+        }
+        public uint GetFloatHexValue()
+        {
+            return (uint)txtIEEE754Float.Value;
+        }
+        public void SetFloatValue(float value)
+        {
+            txtFloat.Value = value.ToString();
+        }
+        public float GetFloatValue()
+        {
+            return Convert.ToSingle(txtFloat.Value);
+        }
+        public void CalculateFloat()
+        {
             ieee754FloatingPointConverter converter = new ieee754FloatingPointConverter();
             converter.HexFloat = txtIEEE754Float.ToUInt32();
             txtFloat.Text = string.Format("{0:R}", converter.Float);
         }
-
-        private void btnConvertToIEEE754Float_Click(object sender, EventArgs e)
+        public void CalculateHexFloat()
         {
             ieee754FloatingPointConverter converter = new ieee754FloatingPointConverter();
             float f;

 

  ViewVC Help
Powered by ViewVC 1.1.22