<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>src/Numerics/Complex32.cs</filename>
    </added>
    <added>
      <filename>src/UnitTests/ComplexTests/Complex32Test.TextHandling.cs</filename>
    </added>
    <added>
      <filename>src/UnitTests/ComplexTests/Complex32Test.cs</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1279,7 +1279,17 @@ namespace MathNet.Numerics
 
         #region Conversion
         /// &lt;summary&gt;
-        /// Explicit conversion of a real decimal to a real &lt;c&gt;Complex&lt;/c&gt;.
+        /// Explicit conversion of a &lt;c&gt;Complex32&lt;/c&gt; to a &lt;c&gt;Complex&lt;/c&gt;.
+        /// &lt;/summary&gt;
+        /// &lt;param name=&quot;value&quot;&gt;The decimal value to convert.&lt;/param&gt;
+        /// &lt;returns&gt;The result of the conversion.&lt;/returns&gt;
+        public static implicit operator Complex(Complex32 value)
+        {
+            return new Complex(value.Real, value.Imaginary);
+        }
+
+        /// &lt;summary&gt;
+        /// Explicit conversion of a real decimal to a &lt;c&gt;Complex&lt;/c&gt;.
         /// &lt;/summary&gt;
         /// &lt;param name=&quot;value&quot;&gt;The decimal value to convert.&lt;/param&gt;
         /// &lt;returns&gt;The result of the conversion.&lt;/returns&gt;
@@ -1289,7 +1299,7 @@ namespace MathNet.Numerics
         }
 
         /// &lt;summary&gt;
-        /// Implicit conversion of a real byte to a real &lt;c&gt;Complex&lt;/c&gt;.
+        /// Implicit conversion of a real byte to a &lt;c&gt;Complex&lt;/c&gt;.
         /// &lt;/summary&gt;
         /// &lt;param name=&quot;value&quot;&gt;The byte value to convert.&lt;/param&gt;
         /// &lt;returns&gt;The result of the conversion.&lt;/returns&gt;
@@ -1299,7 +1309,7 @@ namespace MathNet.Numerics
         }
 
         /// &lt;summary&gt;
-        /// Implicit conversion of a real short to a real &lt;c&gt;Complex&lt;/c&gt;.
+        /// Implicit conversion of a real short to a &lt;c&gt;Complex&lt;/c&gt;.
         /// &lt;/summary&gt;
         /// &lt;param name=&quot;value&quot;&gt;The short value to convert.&lt;/param&gt;
         /// &lt;returns&gt;The result of the conversion.&lt;/returns&gt;
@@ -1309,7 +1319,7 @@ namespace MathNet.Numerics
         }
 
         /// &lt;summary&gt;
-        /// Implicit conversion of a real int to a real &lt;c&gt;Complex&lt;/c&gt;.
+        /// Implicit conversion of a real int to a &lt;c&gt;Complex&lt;/c&gt;.
         /// &lt;/summary&gt;
         /// &lt;param name=&quot;value&quot;&gt;The int value to convert.&lt;/param&gt;
         /// &lt;returns&gt;The result of the conversion.&lt;/returns&gt;
@@ -1319,7 +1329,7 @@ namespace MathNet.Numerics
         }
 
         /// &lt;summary&gt;
-        /// Implicit conversion of a real long to a real &lt;c&gt;Complex&lt;/c&gt;.
+        /// Implicit conversion of a real long to a &lt;c&gt;Complex&lt;/c&gt;.
         /// &lt;/summary&gt;
         /// &lt;param name=&quot;value&quot;&gt;The long value to convert.&lt;/param&gt;
         /// &lt;returns&gt;The result of the conversion.&lt;/returns&gt;
@@ -1329,7 +1339,7 @@ namespace MathNet.Numerics
         }
 
         /// &lt;summary&gt;
-        /// Implicit conversion of a real uint to a real &lt;c&gt;Complex&lt;/c&gt;.
+        /// Implicit conversion of a real uint to a &lt;c&gt;Complex&lt;/c&gt;.
         /// &lt;/summary&gt;
         /// &lt;param name=&quot;value&quot;&gt;The uint value to convert.&lt;/param&gt;
         /// &lt;returns&gt;The result of the conversion.&lt;/returns&gt;
@@ -1339,7 +1349,7 @@ namespace MathNet.Numerics
         }
 
         /// &lt;summary&gt;
-        /// Implicit conversion of a real ulong to a real &lt;c&gt;Complex&lt;/c&gt;.
+        /// Implicit conversion of a real ulong to a &lt;c&gt;Complex&lt;/c&gt;.
         /// &lt;/summary&gt;
         /// &lt;param name=&quot;value&quot;&gt;The ulong value to convert.&lt;/param&gt;
         /// &lt;returns&gt;The result of the conversion.&lt;/returns&gt;
@@ -1349,7 +1359,7 @@ namespace MathNet.Numerics
         }
 
         /// &lt;summary&gt;
-        /// Implicit conversion of a real float to a real &lt;c&gt;Complex&lt;/c&gt;.
+        /// Implicit conversion of a real float to a &lt;c&gt;Complex&lt;/c&gt;.
         /// &lt;/summary&gt;
         /// &lt;param name=&quot;value&quot;&gt;The float value to convert.&lt;/param&gt;
         /// &lt;returns&gt;The result of the conversion.&lt;/returns&gt;
@@ -1359,7 +1369,7 @@ namespace MathNet.Numerics
         }
         
         /// &lt;summary&gt;
-        /// Implicit conversion of a real double to a real &lt;c&gt;Complex&lt;/c&gt;.
+        /// Implicit conversion of a real double to a &lt;c&gt;Complex&lt;/c&gt;.
         /// &lt;/summary&gt;
         /// &lt;param name=&quot;value&quot;&gt;The double value to convert.&lt;/param&gt;
         /// &lt;returns&gt;The result of the conversion.&lt;/returns&gt;</diff>
      <filename>src/Numerics/Complex.cs</filename>
    </modified>
    <modified>
      <diff>@@ -158,5 +158,39 @@ namespace MathNet.Numerics
             token = token.Next;
             return value;
         }
+
+        /// &lt;summary&gt;
+        /// Globalized Parsing: Parse a float number
+        /// &lt;/summary&gt;
+        /// &lt;param name=&quot;token&quot;&gt;First token of the number.&lt;/param&gt;
+        /// &lt;param name=&quot;culture&quot;&gt;Culture Info.&lt;/param&gt;
+        /// &lt;returns&gt;The parsed float number using the given culture information.&lt;/returns&gt;
+        /// &lt;exception cref=&quot;FormatException&quot; /&gt;
+        internal static float ParseSingle(ref LinkedListNode&lt;string&gt; token, CultureInfo culture)
+        {
+            // in case the + and - in scientific notation are separated, join them back together.
+            if (token.Value.EndsWith(&quot;e&quot;, true, culture))
+            {
+                if (token.Next == null || token.Next.Next == null)
+                {
+                    throw new FormatException();
+                }
+
+                token.Value = token.Value + token.Next.Value + token.Next.Next.Value;
+
+                var list = token.List;
+                list.Remove(token.Next.Next);
+                list.Remove(token.Next);
+            }
+
+            float value;
+            if (!Single.TryParse(token.Value, NumberStyles.Any, culture, out value))
+            {
+                throw new FormatException();
+            }
+
+            token = token.Next;
+            return value;
+        }
     }
 }
\ No newline at end of file</diff>
      <filename>src/Numerics/GlobalizationHelper.cs</filename>
    </modified>
    <modified>
      <diff>@@ -72,6 +72,7 @@
     &lt;Compile Include=&quot;Complex.cs&quot; /&gt;
     &lt;Compile Include=&quot;Constants.cs&quot; /&gt;
     &lt;Compile Include=&quot;Control.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Complex32.cs&quot; /&gt;
     &lt;Compile Include=&quot;Distributions\Continuous\Beta.cs&quot; /&gt;
     &lt;Compile Include=&quot;Distributions\Continuous\ContinuousUniform.cs&quot; /&gt;
     &lt;Compile Include=&quot;Distributions\Continuous\LogNormal.cs&quot; /&gt;</diff>
      <filename>src/Numerics/Numerics.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -95,7 +95,10 @@ namespace MathNet.Numerics
         private static readonly int _numberOfDecimalPlacesForFloats;
 
         /// &lt;summary&gt;Value representing 10 * 2^(-52)&lt;/summary&gt;
-        private static readonly double _defaultRelativeAccuracy = _doubleMachinePrecision * 10;
+        private static readonly double _defaultDoubleRelativeAccuracy = _doubleMachinePrecision * 10;
+
+        /// &lt;summary&gt;Value representing 10 * 2^(-52)&lt;/summary&gt;
+        private static readonly float _defaultSingleRelativeAccuracy = (float)(_singleMachinePrecision * 10);
 
         #endregion
 
@@ -691,7 +694,19 @@ namespace MathNet.Numerics
         public static bool AlmostEqual(this double a, double b)
         {
             double diff = a - b;
-            return AlmostEqualWithError(a, b, diff, _defaultRelativeAccuracy);
+            return AlmostEqualWithError(a, b, diff, _defaultDoubleRelativeAccuracy);
+        }
+
+        /// &lt;summary&gt;
+        /// Checks whether two real numbers are almost equal.
+        /// &lt;/summary&gt;
+        /// &lt;param name=&quot;a&quot;&gt;The first number&lt;/param&gt;
+        /// &lt;param name=&quot;b&quot;&gt;The second number&lt;/param&gt;
+        /// &lt;returns&gt;true if the two values differ by no more than 10 * 2^(-52); false otherwise.&lt;/returns&gt;
+        public static bool AlmostEqual(this float a, float b)
+        {
+            double diff = a - b;
+            return AlmostEqualWithError(a, b, diff, _defaultSingleRelativeAccuracy);
         }
 
         /// &lt;summary&gt;
@@ -705,7 +720,7 @@ namespace MathNet.Numerics
             where T : IPrecisionSupport&lt;T&gt;
         {
             double diff = a.NormOfDifference(b);
-            return AlmostEqualWithError(a.Norm(), b.Norm(), diff, _defaultRelativeAccuracy);
+            return AlmostEqualWithError(a.Norm(), b.Norm(), diff, _defaultDoubleRelativeAccuracy);
         }
 
         /// &lt;summary&gt;
@@ -996,6 +1011,62 @@ namespace MathNet.Numerics
         }
 
         /// &lt;summary&gt;
+        /// Compares two floats and determines if they are equal to within the specified number of decimal places or not. If the numbers
+        /// are very close to zero an absolute difference is compared, otherwise the relative difference is compared.
+        /// &lt;/summary&gt;
+        /// &lt;remarks&gt;
+        /// &lt;para&gt;
+        /// The values are equal if the difference between the two numbers is smaller than 10^(-numberOfDecimalPlaces). We divide by 
+        /// two so that we have half the range on each side of the numbers, e.g. if &lt;paramref name=&quot;decimalPlaces&quot;/&gt; == 2, then 0.01 will equal between 
+        /// 0.005 and 0.015, but not 0.02 and not 0.00
+        /// &lt;/para&gt;
+        /// &lt;/remarks&gt;
+        /// &lt;param name=&quot;a&quot;&gt;The first value.&lt;/param&gt;
+        /// &lt;param name=&quot;b&quot;&gt;The second value.&lt;/param&gt;
+        /// &lt;param name=&quot;decimalPlaces&quot;&gt;The number of decimal places.&lt;/param&gt;
+        /// &lt;returns&gt;&lt;see langword=&quot;true&quot; /&gt; if both doubles are equal to each other within the specified number of decimal places; otherwise &lt;see langword=&quot;false&quot; /&gt;.&lt;/returns&gt;
+        /// &lt;exception cref=&quot;ArgumentOutOfRangeException&quot;&gt;
+        ///     Thrown if &lt;paramref name=&quot;decimalPlaces&quot;/&gt; is smaller than zero.
+        /// &lt;/exception&gt;
+        public static bool AlmostEqualInDecimalPlaces(this float a, float b, int decimalPlaces)
+        {
+            if (decimalPlaces &lt;= 0)
+            {
+                // Can't have a negative number of decimal places
+                throw new ArgumentOutOfRangeException(&quot;decimalPlaces&quot;);
+            }
+
+            // If A or B are a NAN, return false. NANs are equal to nothing,
+            // not even themselves.
+            if (double.IsNaN(a) || double.IsNaN(b))
+            {
+                return false;
+            }
+
+            // If A or B are infinity (positive or negative) then
+            // only return true if they are exactly equal to each other -
+            // that is, if they are both infinities of the same sign.
+            if (double.IsInfinity(a) || double.IsInfinity(b))
+            {
+                return a == b;
+            }
+
+            if (Math.Abs(a) &lt; _doubleMachinePrecision || Math.Abs(b) &lt; _doubleMachinePrecision)
+            {
+                return AlmostEqualWithAbsoluteDecimalPlaces(a, b, decimalPlaces);
+            }
+
+            // If both numbers are equal, get out now. This should remove the possibility of both numbers being zero
+            // and any problems associated with that.
+            if (a.Equals(b))
+            {
+                return true;
+            }
+
+            return AlmostEqualWithRelativeDecimalPlaces(a, b, decimalPlaces);
+        }
+
+        /// &lt;summary&gt;
         /// Compares two doubles and determines if they are equal to within the specified number of decimal places or not. 
         /// &lt;/summary&gt;
         /// &lt;remarks&gt;</diff>
      <filename>src/Numerics/Precision.cs</filename>
    </modified>
    <modified>
      <diff>@@ -80,6 +80,28 @@ namespace MathNet.Numerics.UnitTests
             }
         }
 
+
+        /// &lt;summary&gt;
+        /// Asserts that the expected value and the actual value are equal up to a certain number of decimal places.
+        /// &lt;/summary&gt;
+        /// &lt;param name=&quot;expected&quot;&gt;The expected value.&lt;/param&gt;
+        /// &lt;param name=&quot;actual&quot;&gt;The actual value.&lt;/param&gt;
+        /// &lt;param name=&quot;decimalPlaces&quot;&gt;The number of decimal places to agree on.&lt;/param&gt;
+        public static void AlmostEqual(Complex32 expected, Complex32 actual, int decimalPlaces)
+        {
+            bool pass = expected.Real.AlmostEqualInDecimalPlaces(actual.Real, decimalPlaces);
+            if (!pass)
+            {
+                Assert.Fail(&quot;Real components are not equal within {0} places. Expected:{1}; Actual:{2}&quot;, decimalPlaces, expected.Real, actual.Real);
+            }
+
+            pass = expected.Imaginary.AlmostEqualInDecimalPlaces(actual.Imaginary, decimalPlaces);
+            if (!pass)
+            {
+                Assert.Fail(&quot;Imaginary components are not equal within {0} places. Expected:{1}; Actual:{2}&quot;, decimalPlaces, expected.Imaginary, actual.Imaginary);
+            }
+        }
+
         /// &lt;summary&gt;
         /// Asserts that the expected value and the actual value are equal up to a certain
         /// maximum error.</diff>
      <filename>src/UnitTests/AssertHelpers.cs</filename>
    </modified>
    <modified>
      <diff>@@ -794,12 +794,12 @@ namespace MathNet.Numerics.UnitTests.ComplexTests
         }
 
         [Test]
-        public void CanConvertDoulbeComplex()
+        public void CanConvertComplex32ToComplex()
         {
-            const double orginal = 123.456789;
-            var complex = (Complex)orginal;
-            Assert.AreEqual(123.456789, complex.Real);
-            Assert.AreEqual(0.0, complex.Imaginary);
+            var complex32 = new Complex32(123.456f, -78.9f);
+            var complex = (Complex)complex32;
+            Assert.AreEqual(123.456f, (float)complex.Real);
+            Assert.AreEqual(-78.9f, (float)complex.Imaginary);
         }
    }
 }
\ No newline at end of file</diff>
      <filename>src/UnitTests/ComplexTests/ComplexTest.cs</filename>
    </modified>
    <modified>
      <diff>@@ -35,7 +35,7 @@ namespace MathNet.Numerics.UnitTests
     public sealed class PrecisionTest
     {
         private const double _acceptableError = 1e-12;
-        private readonly double _doublePrecision = System.Math.Pow(2, -53);
+        private readonly double _doublePrecision = Math.Pow(2, -53);
 
         [Test]
         public void Magnitude()</diff>
      <filename>src/UnitTests/PrecisionTest.cs</filename>
    </modified>
    <modified>
      <diff>@@ -64,6 +64,8 @@
     &lt;Compile Include=&quot;CombinatoricsTests\CombinatoricsCountingTest.cs&quot; /&gt;
     &lt;Compile Include=&quot;ComplexTests\ComplexTest.TextHandling.cs&quot; /&gt;
     &lt;Compile Include=&quot;ComplexTests\ComplexTest.cs&quot; /&gt;
+    &lt;Compile Include=&quot;ComplexTests\Complex32Test.TextHandling.cs&quot; /&gt;
+    &lt;Compile Include=&quot;ComplexTests\Complex32Test.cs&quot; /&gt;
     &lt;Compile Include=&quot;DistributionTests\CommonDistributionTests.cs&quot; /&gt;
     &lt;Compile Include=&quot;DistributionTests\Continuous\BetaTests.cs&quot; /&gt;
     &lt;Compile Include=&quot;DistributionTests\Continuous\ContinuousUniformTests.cs&quot; /&gt;</diff>
      <filename>src/UnitTests/UnitTests.csproj</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>49d8b712e9fc2f4666bfd08b1f8df5caca81aa49</id>
    </parent>
  </parents>
  <author>
    <name>Marcus Cuda</name>
    <email>marcus@cuda.net</email>
  </author>
  <url>http://github.com/cuda/mathnet-numerics/commit/8f2ee01da2157d9caddc8e565746e85cfee6ff8f</url>
  <id>8f2ee01da2157d9caddc8e565746e85cfee6ff8f</id>
  <committed-date>2009-11-04T04:25:02-08:00</committed-date>
  <authored-date>2009-11-04T04:17:31-08:00</authored-date>
  <message>added complex32 type</message>
  <tree>887f26ac641311d4069db4053c830496b379b5ce</tree>
  <committer>
    <name>Marcus Cuda</name>
    <email>marcus@cuda.net</email>
  </committer>
</commit>
