forked from npgsql/npgsql
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathNumeric.cs
More file actions
46 lines (38 loc) · 1.38 KB
/
Numeric.cs
File metadata and controls
46 lines (38 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System.Collections.Generic;
using BenchmarkDotNet.Attributes;
using Npgsql.Internal.Converters;
namespace Npgsql.Benchmarks.TypeHandlers;
[Config(typeof(Config))]
public class Int16() : TypeHandlerBenchmarks<short>(new Int2Converter<short>());
[Config(typeof(Config))]
public class Int32() : TypeHandlerBenchmarks<int>(new Int4Converter<int>());
[Config(typeof(Config))]
public class Int64() : TypeHandlerBenchmarks<long>(new Int8Converter<long>());
[Config(typeof(Config))]
public class Single() : TypeHandlerBenchmarks<float>(new RealConverter<float>());
[Config(typeof(Config))]
public class Double() : TypeHandlerBenchmarks<double>(new DoubleConverter<double>());
[Config(typeof(Config))]
public class Numeric() : TypeHandlerBenchmarks<decimal>(new DecimalNumericConverter<decimal>())
{
protected override IEnumerable<decimal> ValuesOverride() =>
[
0.0000000000000000000000000001M,
0.000000000000000000000001M,
0.00000000000000000001M,
0.0000000000000001M,
0.000000000001M,
0.00000001M,
0.0001M,
1M,
10000M,
100000000M,
1000000000000M,
10000000000000000M,
100000000000000000000M,
1000000000000000000000000M,
10000000000000000000000000000M
];
}
[Config(typeof(Config))]
public class Money() : TypeHandlerBenchmarks<decimal>(new MoneyConverter<decimal>());