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

47
mcs/tests/test-649.cs Normal file
View File

@@ -0,0 +1,47 @@
using System;
class MainClass
{
public struct Decimal2
{
public Decimal2 (double d)
{
value = new Decimal (d);
}
public Decimal2 (Decimal d)
{
value = d;
}
public static explicit operator Decimal2 (Decimal d)
{
return new Decimal2 (d);
}
public static explicit operator Decimal2 (double d)
{
return new Decimal2 (d);
}
public static implicit operator Decimal (Decimal2 d)
{
return d.value;
}
private Decimal value;
}
public static void Main (string [] args)
{
Console.WriteLine ("double = {0}", 1.1367 * 11.9767 - 0.6);
Console.WriteLine ("Decimal2 = {0}", ((Decimal2) 1.1367 * (Decimal2) 11.9767 - (Decimal2) 0.6));
Console.WriteLine ("Decimal2 = {0}", new Decimal2 (1.1367) * (Decimal2) 11.9767 - (Decimal2) 0.6);
Console.WriteLine ("Decimal2 = {0}", (Decimal2) 11.9767 * new Decimal2 (1.1367) - (Decimal2) 0.6);
Console.WriteLine ("Decimal2 = {0}", (new Decimal2 (1.1367) * (Decimal2) 11.9767 - (Decimal2) 0.6));
Console.WriteLine ("Decimal2 = {0}", ((Decimal2) 1.1367 * (Decimal2) 11.9767 - (Decimal) 0.6));
Console.WriteLine ("Decimal2 = {0}", (1.14 * 11.9767 - 0.6));
Console.WriteLine ("Decimal2 = {0}", ((Decimal2) 1.1367 * (Decimal) 11.9767 - (Decimal2) 0.6));
Console.WriteLine ("Decimal2 = {0}", ((Decimal2) 1.1367 * (Decimal2) 11.9767 - (Decimal2) 0.6));
}
}