Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
//
// AssemblyInfo.cs
//
// Authors:
// Marek Safar (marek.safar@gmail.com)
//
// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Reflection;
using System.Resources;
using System.Security;
using System.Security.Permissions;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about the assembly
[assembly: AssemblyTitle ("System.Numerics.dll")]
[assembly: AssemblyDescription ("System.Numerics.dll")]
[assembly: AssemblyDefaultAlias ("System.Numerics.dll")]
[assembly: AssemblyCompany (Consts.MonoCompany)]
[assembly: AssemblyProduct (Consts.MonoProduct)]
[assembly: AssemblyCopyright (Consts.MonoCopyright)]
[assembly: AssemblyVersion (Consts.FxVersion)]
[assembly: SatelliteContractVersion (Consts.FxVersion)]
[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../ecma.pub")]
[assembly: SecurityCritical]
[assembly: ComVisible (false)]

View File

@@ -0,0 +1 @@
239106ef4cc65436925741cb574bec20c44838d3

View File

@@ -0,0 +1 @@
64eb2ee06b36bdb5ef875b697510b080d4ddfe83

View File

@@ -0,0 +1,63 @@
<Overview>
<Assemblies>
<Assembly Name="System.Numerics" Version="4.0.0.0">
<AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ]</AssemblyPublicKey>
<Attributes>
<Attribute>
<AttributeName>System.CLSCompliant(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Reflection.AssemblyCompany("Mono development team")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Reflection.AssemblyCopyright("(c) Various Mono authors")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Reflection.AssemblyDefaultAlias("System.Numerics.dll")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Reflection.AssemblyDescription("System.Numerics.dll")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Reflection.AssemblyFileVersion("4.0.30319.17020")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Reflection.AssemblyInformationalVersion("4.0.30319.17020")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Reflection.AssemblyProduct("Mono Common Language Infrastructure")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Reflection.AssemblyTitle("System.Numerics.dll")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Resources.NeutralResourcesLanguage("en-US")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Resources.SatelliteContractVersion("4.0.0.0")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.InteropServices.ComVisible(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Security.SecurityCritical</AttributeName>
</Attribute>
</Attributes>
</Assembly>
</Assemblies>
<Remarks>To be added.</Remarks>
<Copyright>To be added.</Copyright>
<Types>
<Namespace Name="System.Numerics">
<Type Name="BigInteger" Kind="Structure" />
<Type Name="Complex" Kind="Structure" />
</Namespace>
</Types>
<Title>System.Numerics</Title>
</Overview>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Namespace Name="System.Numerics">
<Docs>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <see cref="N:System.Numerics" /> namespace contains numeric types that complement the numeric primitives, such as <see cref="T:System.Byte" />, <see cref="T:System.Double" />, and <see cref="T:System.Int32" />, that are defined by the .NET Framework.</para>
</summary>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This namespace includes the following types:</para>
<list type="bullet">
<item>
<para>The <see cref="T:System.Numerics.BigInteger" /> structure, which is a nonprimitive integral type that supports arbitrarily large integers. An integral primitive such as <see cref="T:System.Byte" /> or <see cref="T:System.Int32" /> includes a MinValue and a MaxValue property, which define the lower bound and upper bound supported by that data type. In contrast, the <see cref="T:System.Numerics.BigInteger" /> structure has no lower or upper bound, and can contain the value of any integer.</para>
</item>
<item>
<para>The <see cref="T:System.Numerics.Complex" /> structure, which represents a complex number. A complex number is a number in the form a + bi, where a is the real part, and b is the imaginary part. </para>
</item>
</list>
</remarks>
</Docs>
</Namespace>

View File

@@ -0,0 +1,20 @@
thisdir = class/System.Numerics
SUBDIRS =
include ../../build/rules.make
LIBRARY = System.Numerics.dll
LIB_MCS_FLAGS = -r:System.dll
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
EXTRA_DISTFILES =
VALID_PROFILE := $(filter 4, $(FRAMEWORK_VERSION_MAJOR)) $(filter 2.1, $(FRAMEWORK_VERSION))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.Numerics.dll
NO_INSTALL = yes
NO_SIGN_ASSEMBLY = yes
NO_TEST = yes
endif
include ../../build/library.make

View File

@@ -0,0 +1,4 @@
../../build/common/Consts.cs
Assembly/AssemblyInfo.cs
System.Numerics/Complex.cs
System.Numerics/BigInteger.cs

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,200 @@
2013-06-12 Christoph Ruegg <git@cdrnet.ch>
* BigInteger.cs: Fix GreatestCommonDivisor to
return absolute value if one of the args is zero.
2013-06-09 Christoph Ruegg <git@cdrnet.ch>
* Complex.cs: Fix IFormattable.ToString to pass custom
format strings to double.ToString instead of string.Format.
2010-07-12 Jb Evain <jbevain@novell.com>
* Complex.cs: implement IFormattable.
2010-07-08 Jb Evain <jbevain@novell.com>
* Complex.cs: implement the different ToString overrides.
2010-07-08 Jb Evain <jbevain@novell.com>
* Complex.cs: Fix Phase. Implement Acos, Asin, Atan, Exp,
Log, Log10, Pow and Sqrt.
2010-04-23 Marek Safar <marek.safar@gmail.com>
* Complex.cs: Add explicit BigInteger operator.
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Simply Parse/TryParse.
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Add decimal operators/ctor.
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Float/double coersion operators.
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Remaining ToString overloads.
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: double and float coersion ops.
ToString() and ToString(string).
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: .ctor(double) and .ctor(float).
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Log.
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: GreatestCommonDivisor.
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: ModPow.
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: / % Pow.
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: DivRem.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Simplify Mul.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Mul.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: coersion operators for short, ushort,
byte and sbyte.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: <<, >>.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: | & ^ ~.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: ++ --, unary +.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Abs.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Min, Max.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Negate.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Sub.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: All relational ops for long.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: No need to special case long.MinValue
or int.MinValue as 2 complement negate solves it.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: long CompareTo.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: IComparable.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Relational ops for ulong with switched args.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Equals(ulong) and missing CLSCompliant.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Relational ops for ulong. Fix CoreCompare.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Add constructor and coersion operators
for ulong.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Add constructor and coersion operators
for uint.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Implement -1,0,1 props. Don't allocate
zero array.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Implement IComparable and IEquatable.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Compare and relational ops.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Add.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: GetHashCode.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Equals.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: Added implicit long operator.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
*BigInteger.cs: Added long constructor and coersion operator.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
* BigInteger.cs: The DLR version is close to useless. Replaced
by the initial bits of something that is API compliant.
2009-10-31 Miguel de Icaza <miguel@novell.com>
* Add BigInteger.cs from the DLR 0.92, the patch in the directory
above this one contains the patch against the original
BigIntegerv2.cs source code.
2009-10-20 Marek Safar <marek.safar@gmail.com>
* ChangeLog: Added

View File

@@ -0,0 +1,349 @@
//
// Complex.cs: Complex number support
//
// Author:
// Miguel de Icaza (miguel@gnome.org)
// Marek Safar (marek.safar@gmail.com)
// Jb Evain (jbevain@novell.com)
//
// Copyright 2009, 2010 Novell, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace System.Numerics {
public struct Complex : IEquatable<Complex>, IFormattable
{
double real, imaginary;
public static readonly Complex ImaginaryOne = new Complex (0, 1);
public static readonly Complex One = new Complex (1, 0);
public static readonly Complex Zero = new Complex (0, 0);
public double Imaginary {
get { return imaginary; }
}
public double Real {
get { return real; }
}
public double Magnitude {
get { return Math.Sqrt (imaginary * imaginary + real * real); }
}
public double Phase {
get { return Math.Atan2 (imaginary, real); }
}
public Complex (double real, double imaginary)
{
this.imaginary = imaginary;
this.real = real;
}
public static Complex FromPolarCoordinates (double magnitude, double phase)
{
return new Complex (magnitude * Math.Cos (phase), magnitude * Math.Sin (phase));
}
public static Complex operator + (Complex left, Complex right)
{
return new Complex (left.real + right.real, left.imaginary + right.imaginary);
}
public static Complex Add (Complex left, Complex right)
{
return new Complex (left.real + right.real, left.imaginary + right.imaginary);
}
public static Complex operator - (Complex left, Complex right)
{
return new Complex (left.real - right.real, left.imaginary - right.imaginary);
}
public static Complex Subtract (Complex left, Complex right)
{
return new Complex (left.real - right.real, left.imaginary - right.imaginary);
}
public static Complex operator * (Complex left, Complex right)
{
return new Complex (
left.real * right.real - left.imaginary * right.imaginary,
left.real * right.imaginary + left.imaginary * right.real);
}
public static Complex Multiply (Complex left, Complex right)
{
return new Complex (
left.real * right.real - left.imaginary * right.imaginary,
left.real * right.imaginary + left.imaginary * right.real);
}
public static Complex operator / (Complex left, Complex right)
{
double rsri = right.real * right.real + right.imaginary * right.imaginary;
return new Complex (
(left.real * right.real + left.imaginary * right.imaginary) / rsri,
(left.imaginary * right.real - left.real * right.imaginary) / rsri);
}
public static Complex Divide (Complex dividend, Complex divisor)
{
double rsri = divisor.real * divisor.real + divisor.imaginary * divisor.imaginary;
return new Complex (
(dividend.real * divisor.real + dividend.imaginary * divisor.imaginary) / rsri,
(dividend.imaginary * divisor.real - dividend.real * divisor.imaginary) / rsri);
}
public static bool operator == (Complex left, Complex right)
{
return left.real == right.real && left.imaginary == right.imaginary;
}
public bool Equals (Complex value)
{
return real == value.real && imaginary == value.imaginary;
}
public override bool Equals (object obj)
{
if (obj == null || !(obj is Complex))
return false;
Complex r = (Complex) obj;
return real == r.real && imaginary == r.imaginary;
}
public static bool operator != (Complex left, Complex right)
{
return left.real != right.real || left.imaginary != right.imaginary;
}
public static Complex operator - (Complex value)
{
return new Complex (-value.real, -value.imaginary);
}
public static implicit operator Complex (byte value)
{
return new Complex (value, 0);
}
public static implicit operator Complex (double value)
{
return new Complex (value, 0);
}
public static implicit operator Complex (short value)
{
return new Complex (value, 0);
}
public static implicit operator Complex (int value)
{
return new Complex (value, 0);
}
public static implicit operator Complex (long value)
{
return new Complex (value, 0);
}
[CLSCompliant (false)]
public static implicit operator Complex (sbyte value)
{
return new Complex (value, 0);
}
public static implicit operator Complex (float value)
{
return new Complex (value, 0);
}
[CLSCompliant (false)]
public static implicit operator Complex (ushort value)
{
return new Complex (value, 0);
}
[CLSCompliant (false)]
public static implicit operator Complex (uint value)
{
return new Complex (value, 0);
}
[CLSCompliant (false)]
public static implicit operator Complex (ulong value)
{
return new Complex (value, 0);
}
public static explicit operator Complex (decimal value)
{
return new Complex ((double) value, 0);
}
public static explicit operator Complex (BigInteger value)
{
return new Complex ((double) value, 0);
}
public static double Abs (Complex value)
{
return Math.Sqrt (value.imaginary * value.imaginary + value.real * value.real);
}
public static Complex Conjugate (Complex value)
{
return new Complex (value.real, -value.imaginary);
}
public static Complex Cos (Complex value)
{
return new Complex (Math.Cos (value.real) * Math.Cosh (value.imaginary),
-Math.Sin (value.real) * Math.Sinh (value.imaginary));
}
public static Complex Cosh (Complex value)
{
return new Complex (Math.Cosh (value.real) * Math.Cos (value.imaginary),
Math.Sinh (value.real) * Math.Sin (value.imaginary));
}
public static Complex Negate (Complex value)
{
return -value;
}
public static Complex Sin (Complex value)
{
return new Complex (Math.Sin (value.real) * Math.Cosh (value.imaginary),
Math.Cos (value.real) * Math.Sinh (value.imaginary));
}
public static Complex Sinh (Complex value)
{
return new Complex (Math.Sinh (value.real) * Math.Cos (value.imaginary),
Math.Cosh (value.real) * Math.Sin (value.imaginary));
}
public static Complex Reciprocal (Complex value)
{
if (value == Zero)
return value;
return One / value;
}
public static Complex Tan (Complex value)
{
return Sin (value) / Cos (value);
}
public static Complex Tanh (Complex value)
{
return Sinh (value) / Cosh (value);
}
public static Complex Acos (Complex value)
{
return -ImaginaryOne * Log (value + (ImaginaryOne * Sqrt (One - (value * value))));
}
public static Complex Asin (Complex value)
{
return -ImaginaryOne * Log ((ImaginaryOne * value) + Sqrt (One - (value * value)));
}
public static Complex Atan (Complex value)
{
return (ImaginaryOne / new Complex (2, 0)) * (Log (One - (ImaginaryOne * value)) - Log (One + (ImaginaryOne * value)));
}
public static Complex Exp (Complex value)
{
var e = Math.Exp (value.real);
return new Complex (e * Math.Cos (value.imaginary), e * Math.Sin (value.imaginary));
}
public static Complex Log (Complex value)
{
return new Complex (Math.Log (Abs (value)), value.Phase);
}
public static Complex Log (Complex value, double baseValue)
{
return Log (value) / Log (new Complex (baseValue, 0));
}
public static Complex Log10 (Complex value)
{
return Log (value, 10);
}
public static Complex Sqrt (Complex value)
{
return FromPolarCoordinates (Math.Sqrt (value.Magnitude), value.Phase / 2);
}
public static Complex Pow (Complex value, double power)
{
return Pow (value, new Complex (power, 0));
}
public static Complex Pow (Complex value, Complex power)
{
return Exp (Log (value) * power);
}
public override int GetHashCode ()
{
return real.GetHashCode () ^ imaginary.GetHashCode ();
}
public override string ToString ()
{
return string.Format ("({0}, {1})", real, imaginary);
}
public string ToString (IFormatProvider provider)
{
return string.Format (provider, "({0}, {1})", real, imaginary);
}
public string ToString (string format)
{
return string.Format ("({0}, {1})", real.ToString (format), imaginary.ToString (format));
}
public string ToString (string format, IFormatProvider provider)
{
return string.Format ("({0}, {1})", real.ToString (format, provider), imaginary.ToString (format, provider));
}
}
}

View File

@@ -0,0 +1,2 @@
System.Numerics/BigIntegerTest.cs
System.Numerics/ComplexTest.cs

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,121 @@
2013-06-13 Christoph Ruegg <git@cdrnet.ch>
* BigIntegerTest.cs: Extended tests for
GreatestCommonDivisor to cover zero-args.
2013-06-09 Christoph Ruegg <git@cdrnet.ch>
* ComplexTest.cs: Created; Tests ToString
with special format strings.
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for decimal stuff.
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for remaining ToString
overloads.
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for ToString and
ToString(string).
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for .ctor(double).
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for Log.
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for GreatestCommonDivisor.
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for ModPow.
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for Pow.
2010-03-06 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for DivRem.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for Mul.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for coersion operators
for short.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for << >>.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for | & ^ ~.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for ++, --.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for Abs.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for Min, Max.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for Negate.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for Sub.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for long CompareTo.
2010-03-05 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for IComparable.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for ulong relational ops with switched
arguments.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for ulong Compare and relational ops.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
* BigIntegerTest.cs: Tests for Compare and relational ops.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
*BigIntegerTest.cs: Tests for Add.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
*BigIntegerTest.cs: Tests for Equals.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
*BigIntegerTest.cs: Tests for long constructor and coersion operator.
2010-03-04 Rodrigo Kumpera <rkumpera@novell.com>
*BigIntegerTest.cs: Added.

View File

@@ -0,0 +1,32 @@
// ComplexTest.cs
//
// Authors:
// Christoph Ruegg <git@cdrnet.ch>
//
// Copyright (C) 2013 Novell, Inc (http://www.novell.com)
//
using System;
using System.Numerics;
using System.Globalization;
using NUnit.Framework;
namespace MonoTests.System.Numerics
{
[TestFixture]
public class ComplexTest
{
[Test]
public void TestToStringFormats ()
{
Assert.AreEqual ("(1, 2)", new Complex (1, 2).ToString (), "#1");
Assert.AreEqual ("(1, 2)", new Complex (1, 2).ToString ("G"), "#2");
Assert.AreEqual ("(1, 2)", new Complex (1, 2).ToString ((string)null), "#3");
IFormatProvider provider = CultureInfo.InvariantCulture;
Assert.AreEqual ("(1, 2)", new Complex (1, 2).ToString (provider), "#4");
Assert.AreEqual ("(1, 2)", new Complex (1, 2).ToString ("G", provider), "#5");
Assert.AreEqual ("(1, 2)", new Complex (1, 2).ToString ((string)null, provider), "#6");
}
}
}