2009-12-09 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / test-649.cs
blob5a4d16eb9511b5ad92282a248c7f5b0f12f19e25
1 using System;
3 class MainClass
5 public struct Decimal2
7 public Decimal2 (double d)
9 value = new Decimal (d);
12 public Decimal2 (Decimal d)
14 value = d;
17 public static explicit operator Decimal2 (Decimal d)
19 return new Decimal2 (d);
22 public static explicit operator Decimal2 (double d)
24 return new Decimal2 (d);
27 public static implicit operator Decimal (Decimal2 d)
29 return d.value;
32 private Decimal value;
35 public static void Main (string [] args)
37 Console.WriteLine ("double = {0}", 1.1367 * 11.9767 - 0.6);
38 Console.WriteLine ("Decimal2 = {0}", ((Decimal2) 1.1367 * (Decimal2) 11.9767 - (Decimal2) 0.6));
39 Console.WriteLine ("Decimal2 = {0}", new Decimal2 (1.1367) * (Decimal2) 11.9767 - (Decimal2) 0.6);
40 Console.WriteLine ("Decimal2 = {0}", (Decimal2) 11.9767 * new Decimal2 (1.1367) - (Decimal2) 0.6);
41 Console.WriteLine ("Decimal2 = {0}", (new Decimal2 (1.1367) * (Decimal2) 11.9767 - (Decimal2) 0.6));
42 Console.WriteLine ("Decimal2 = {0}", ((Decimal2) 1.1367 * (Decimal2) 11.9767 - (Decimal) 0.6));
43 Console.WriteLine ("Decimal2 = {0}", (1.14 * 11.9767 - 0.6));
44 Console.WriteLine ("Decimal2 = {0}", ((Decimal2) 1.1367 * (Decimal) 11.9767 - (Decimal2) 0.6));
45 Console.WriteLine ("Decimal2 = {0}", ((Decimal2) 1.1367 * (Decimal2) 11.9767 - (Decimal2) 0.6));