Skip to content

Commit

Permalink
Bump deps, cleanup, typo fixes, add missing overloads.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikernet committed Mar 12, 2024
1 parent 707f45c commit 01c8d83
Show file tree
Hide file tree
Showing 25 changed files with 1,651 additions and 1,566 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: nuget
target-branch: main
directory: "/Source"
schedule:
interval: weekly
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
target-branch: main
8 changes: 4 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
Expand All @@ -35,9 +35,9 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
Expand Down
20 changes: 11 additions & 9 deletions Docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@

## Overview

**BigDecimal** is a fully-featured decimal type that supports arbitrarily large precision values. It has all the mathematical operators, string conversions and parsing functionality (with full `NumberStyles` support) that you would expect from a complete implementation and performance has been highly optimized for values of all sizes. All operations are exact except for divisions which result in repeating decimals, and the behavior of all the methods is well documented so there are no surprises.
**BigDecimal** is a fully-featured decimal type that supports arbitrarily large precision values with an API that matches standard .NET numeric types so usage should feel natural and familiar. It has all the mathematical operators, string conversions and parsing functionality (including full `NumberStyles` support) that you would expect from a complete implementation and performance has been highly optimized for values of all sizes. All operations are exact except for divisions that result in repeating decimals, and the behavior of all the methods is well documented so there are no surprises.

**Singulink.Numerics.BigDecimal** is part of the **Singulink Libraries** collection. Visit https://github.com/Singulink/ to see the full list of libraries available.
### About Singulink

We are a small team of engineers and designers dedicated to building beautiful, functional and well-engineered software solutions. We offer very competitive rates as well as fixed-price contracts and welcome inquiries to discuss any custom development / project support needs you may have.

This package is part of our **Singulink Libraries** collection. Visit https://github.com/Singulink to see our full list of publicly available libraries and other open-source projects.

## Installation

The package is available on NuGet - simply install the `Singulink.Numerics.BigDecimal` package.

**Supported Runtimes**: Anywhere .NET Standard 2.0+ is supported, including:
- .NET Core 2.0+
- .NET Framework 4.6.1+
- Mono 5.4+
- Xamarin.iOS 10.14+
- Xamarin.Android 8.0+
**Supported Runtimes**: Everywhere .NET Standard 2.0 is supported, including:
- .NET
- .NET Framework
- Mono / Xamarin

The package multitargets .NET Standard 2.1 for extra performance optimizations and .NET 7 for generic math support.
End-of-life runtime versions that are no longer officially supported are not tested or supported by this library.

## Information and Links

Expand Down
71 changes: 68 additions & 3 deletions Source/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Remove the line below if you want to inherit .editorconfig settings from higher directories
# Root editor config for all projects in the repo
root = true


Expand All @@ -9,6 +9,25 @@ root = true

guidelines = 160

########### Project XML files ###########
[*.csproj]

indent_size = 2
indent_style = space
tab_width = 2

[*.props]

indent_size = 2
indent_style = space
tab_width = 2

[*.targets]

indent_size = 2
indent_style = space
tab_width = 2

########### C# files ###########
[*.cs]

Expand Down Expand Up @@ -71,10 +90,13 @@ dotnet_code_quality_unused_parameters = all:suggestion

#### C# Coding Conventions ####

# Namespace preferences
csharp_style_namespace_declarations = file_scoped:warning

# var preferences
csharp_style_var_elsewhere = false:silent
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_for_built_in_types = false:warning
csharp_style_var_when_type_is_apparent = true:warning

# Expression-bodied members
csharp_style_expression_bodied_accessors = true:suggestion
Expand Down Expand Up @@ -174,6 +196,14 @@ dotnet_naming_rule.types_should_be_pascalcase.severity = warning
dotnet_naming_rule.types_should_be_pascalcase.symbols = types
dotnet_naming_rule.types_should_be_pascalcase.style = pascalcase

dotnet_naming_rule.private_static_field_should_be_s_prefixed_camelcase.severity = none
dotnet_naming_rule.private_static_field_should_be_s_prefixed_camelcase.symbols = private_static_field
dotnet_naming_rule.private_static_field_should_be_s_prefixed_camelcase.style = prefixed_camelcase

dotnet_naming_rule.private_field_should_be_prefixed_camelcase.severity = warning
dotnet_naming_rule.private_field_should_be_prefixed_camelcase.symbols = private_field
dotnet_naming_rule.private_field_should_be_prefixed_camelcase.style = prefixed_camelcase

dotnet_naming_rule.constant_field_should_be_pascalcase.severity = warning
dotnet_naming_rule.constant_field_should_be_pascalcase.symbols = constant_field
dotnet_naming_rule.constant_field_should_be_pascalcase.style = pascalcase
Expand All @@ -199,12 +229,25 @@ dotnet_naming_symbols.constant_field.applicable_kinds = field
dotnet_naming_symbols.constant_field.applicable_accessibilities = public, internal, private, protected, protected_internal
dotnet_naming_symbols.constant_field.required_modifiers = const

dotnet_naming_symbols.private_static_field.applicable_kinds = field
dotnet_naming_symbols.private_static_field.applicable_accessibilities = private
dotnet_naming_symbols.private_static_field.required_modifiers = static

dotnet_naming_symbols.private_field.applicable_kinds = field
dotnet_naming_symbols.private_field.applicable_accessibilities = private
dotnet_naming_symbols.private_field.required_modifiers =

# Naming styles
dotnet_naming_style.pascalcase.required_prefix =
dotnet_naming_style.pascalcase.required_suffix =
dotnet_naming_style.pascalcase.word_separator =
dotnet_naming_style.pascalcase.capitalization = pascal_case

dotnet_naming_style.prefixed_camelcase.required_prefix = _
dotnet_naming_style.prefixed_camelcase.required_suffix =
dotnet_naming_style.prefixed_camelcase.word_separator =
dotnet_naming_style.prefixed_camelcase.capitalization = camel_case

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
Expand All @@ -213,6 +256,10 @@ dotnet_naming_style.begins_with_i.capitalization = pascal_case

#### Analyzer diagnostics ####

stylecop.documentation.documentExposedElements = true
stylecop.documentation.documentInternalElements = false
stylecop.documentation.documentInterfaces = false

# SA1503: Braces should not be omitted
dotnet_diagnostic.SA1503.severity = none

Expand Down Expand Up @@ -332,3 +379,21 @@ dotnet_diagnostic.SA1519.severity = silent

# SA1214: Readonly fields should appear before non-readonly fields
dotnet_diagnostic.SA1214.severity = suggestion

# SA1518: Use line endings correctly at end of file
dotnet_diagnostic.SA1518.severity = none

# SA1402: File may only contain a single type
dotnet_diagnostic.SA1402.severity = none

# IDE0028: Simplify collection initialization
dotnet_diagnostic.IDE0028.severity = warning

# IDE0057: Use range operator
dotnet_diagnostic.IDE0057.severity = warning

# IDE0059: Unnecessary assignment of a value
dotnet_diagnostic.IDE0059.severity = warning

# RS0030: Do not use banned APIs
dotnet_diagnostic.RS0030.severity = error
10 changes: 8 additions & 2 deletions Source/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<WeaverConfiguration>
<Weavers>
<RuntimeNullables />
</Weavers>
</WeaverConfiguration>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
Expand All @@ -15,7 +21,7 @@

<!-- Analyzers -->
<PackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" PrivateAssets="all" />
<PackageReference Include="Roslynator.Analyzers" Version="4.7.0" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="all" />
<PackageReference Include="Roslynator.Analyzers" Version="4.11.0" PrivateAssets="all" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Singulink.Numerics.Tests;

[TestClass]
[PrefixTestClass]
public class AssociativeTests
{
[TestMethod]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Singulink.Numerics.Tests;

namespace Singulink.Numerics.Tests;

[TestClass]
[PrefixTestClass]
public class ConvertToBigDecimalTests
{
[TestMethod]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Singulink.Numerics.Tests;

namespace Singulink.Numerics.Tests;

[TestClass]
[PrefixTestClass]
public class MathOperationTests
{
[TestMethod]
Expand Down
10 changes: 2 additions & 8 deletions Source/Singulink.Numerics.BigDecimal.Tests/ParseTests.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Globalization;

namespace Singulink.Numerics.Tests;

[TestClass]
[PrefixTestClass]
public class ParseTests
{
[TestMethod]
Expand Down
6 changes: 2 additions & 4 deletions Source/Singulink.Numerics.BigDecimal.Tests/RoundingTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Singulink.Numerics.Tests;

namespace Singulink.Numerics.Tests;

[TestClass]
[PrefixTestClass]
public class RoundingTests
{
[TestMethod]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0-preview-23577-04" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
<PackageReference Include="coverlet.collector" Version="6.0.1"/>
<PackageReference Include="PrefixClassName.MsTest" Version="1.2.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System;
using System.Globalization;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Globalization;

namespace Singulink.Numerics.Tests;

[TestClass]
[PrefixTestClass]
public class StringFormattingTests
{
[TestMethod]
Expand Down
2 changes: 2 additions & 0 deletions Source/Singulink.Numerics.BigDecimal.Tests/Usings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
global using Microsoft.VisualStudio.TestTools.UnitTesting;
global using PrefixClassName.MsTest;
24 changes: 24 additions & 0 deletions Source/Singulink.Numerics.BigDecimal.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,28 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{BFF58257
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Singulink.Numerics.BigDecimal.Tests", "Singulink.Numerics.BigDecimal.Tests\Singulink.Numerics.BigDecimal.Tests.csproj", "{45D09D15-3C40-44CF-BCDD-52AC75A22FE6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{FB50DCE8-0FE6-41E0-8B5A-78F75877E6A3}"
ProjectSection(SolutionItems) = preProject
..\.github\dependabot.yml = ..\.github\dependabot.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{497F71F4-0EBE-4147-90EA-705CD858B3F4}"
ProjectSection(SolutionItems) = preProject
..\Docs\docfx.json = ..\Docs\docfx.json
..\Docs\index.md = ..\Docs\index.md
..\Docs\toc.yml = ..\Docs\toc.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{BE9E0348-5C28-48D3-8152-4F61032069F6}"
ProjectSection(SolutionItems) = preProject
..\.github\workflows\build-and-test.yml = ..\.github\workflows\build-and-test.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "api", "api", "{D1A1D6AB-1FAB-4655-8545-B1A7B659AA86}"
ProjectSection(SolutionItems) = preProject
..\Docs\api\index.md = ..\Docs\api\index.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -57,6 +79,8 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{45D09D15-3C40-44CF-BCDD-52AC75A22FE6} = {BFF58257-7C21-4F5C-84D1-80E07B8AB8CD}
{BE9E0348-5C28-48D3-8152-4F61032069F6} = {FB50DCE8-0FE6-41E0-8B5A-78F75877E6A3}
{D1A1D6AB-1FAB-4655-8545-B1A7B659AA86} = {497F71F4-0EBE-4147-90EA-705CD858B3F4}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8D945EE2-B1AC-4666-BC91-156394840F36}
Expand Down
Loading

0 comments on commit 01c8d83

Please sign in to comment.