Skip to content

Instantly share code, notes, and snippets.

@KTSnowy
KTSnowy / BigDecimal.cs
Created October 17, 2022 18:00 — forked from JcBernack/BigDecimal.cs
BigDecimal
using System;
using System.Numerics;
namespace Common
{
/// <summary>
/// Arbitrary precision decimal.
/// All operations are exact, except for division. Division never determines more digits than the given precision.
/// Source: https://gist.github.com/JcBernack/0b4eef59ca97ee931a2f45542b9ff06d
/// Based on https://stackoverflow.com/a/4524254