You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is assumed that it is possible to add extension methods for BigDecimal by converting BigDecimal to BigInteger and reusing extension methods for BigInteger.
We should check what is currently available on the BigDecimal data type in C#, see how other libraries work with it.
If there is nothing suitable, then, perhaps, implement the BigDecimal data type yourself. And add implementations of mathematical methods to this class.
The text was updated successfully, but these errors were encountered:
If you have to release the BigDecimal type yourself, I suggest the following. Store it in memory as a structure with fields: uint field for the number of decimal places after the decimal point, and BigInteger field for storing the value itself and its sign. In binary form, first serialize 4 bytes of the uint field, then the BigInteger as is. In text form, serialize as a number with the number of decimal places equal to uint field value, even if this results in writing insignificant zeros.
If you have to release the BigDecimal type yourself, it is worth to put this type in namespace TheSquid.Numerics, do it in a separate repository TheSquid.Numerics and release as a separate assembly, which can be used in the assembly TheSquid.Numerics.Extensions.
It is assumed that it is possible to add extension methods for
BigDecimal
by convertingBigDecimal
toBigInteger
and reusing extension methods forBigInteger
.We should check what is currently available on the
BigDecimal
data type in C#, see how other libraries work with it.If there is nothing suitable, then, perhaps, implement the
BigDecimal
data type yourself. And add implementations of mathematical methods to this class.The text was updated successfully, but these errors were encountered: