1 // Compiler options: -r:test-319-lib.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;
20 const decimal SmallConstValue
= .02M
;
24 Type t
= typeof (ConstFields
);
25 DecimalConstantAttribute a
= (DecimalConstantAttribute
) t
.GetField ("ConstDecimal3").GetCustomAttributes (typeof (DecimalConstantAttribute
), false) [0];
26 if (a
.Value
!= ConstDecimal3
)
29 a
= (DecimalConstantAttribute
) t
.GetField ("ConstDecimal1").GetCustomAttributes (typeof (DecimalConstantAttribute
), false) [0];
30 if (a
.Value
!= 314159265358979323846m
)
33 if (ConstDecimal1
!= (-1) * ConstDecimal2
)
36 if (!(SmallConstValue
< 1 && SmallConstValue
> 0))
40 Console
.WriteLine (C
.D
);
41 Console
.WriteLine (Decimal
.One
);
42 Console
.WriteLine (DecimalValue
);
43 Console
.WriteLine (Decimal
.MaxValue
);
45 Console
.WriteLine ("Success");