1 // Compiler options: -r:test-319-dll.dll
4 using System.Runtime.CompilerServices;
6 // TODO: clean up in Decimal.cs
8 public class ConstFields
10 public const decimal ConstDecimal1 = 314159265358979323846m;
11 public static readonly decimal ConstDecimal2 = -314159265358979323846m;
12 public const decimal ConstDecimal3 = -3;
13 public const decimal ConstDecimal4 = 0;
14 public const decimal MaxValue = 79228162514264337593543950335m;
16 // TODO: check this value
17 static readonly Decimal MaxValueDiv10 = MaxValue / 10;
19 static decimal DecimalValue = -90;
23 Type t = typeof (ConstFields);
24 DecimalConstantAttribute a = (DecimalConstantAttribute) t.GetField ("ConstDecimal3").GetCustomAttributes (typeof (DecimalConstantAttribute), false) [0];
25 if (a.Value != ConstDecimal3)
28 a = (DecimalConstantAttribute) t.GetField ("ConstDecimal1").GetCustomAttributes (typeof (DecimalConstantAttribute), false) [0];
29 if (a.Value != 314159265358979323846m)
32 if (ConstDecimal1 != (-1) * ConstDecimal2)
36 Console.WriteLine (C.D);
37 Console.WriteLine (Decimal.One);
38 Console.WriteLine (DecimalValue);
39 Console.WriteLine (Decimal.MaxValue);
41 Console.WriteLine ("Success");