LongCalc Arbitrary Precision Float and Complex Number Library
See the version list below for details.
Install-Package LongCalc -Version 0.4.9
dotnet add package LongCalc --version 0.4.9
<PackageReference Include="LongCalc" Version="0.4.9" />
paket add LongCalc --version 0.4.9
Investigated crashes of the software. Found that bf object initializations work fine when x.mant and x.twoexp components (of type mpz_t) have bitlength less or equal 17179869120. Found that crashes consistently occur when bitlength of either is greater than 17179869120 (when testing on three machines, with memory 7.45GB, 6GB, 16GB. one machine early Intel i5, one machine a more recent AMD processor, one machine a more recent Intel i7. Although bf intitialization worked fine at or below the indicated threshold on all three, one machine experienced crashes of the debugger near the threshold when running in debug mode.) bcr and bcp object creations would work fine if the underlying bf objects were at or below threshold. This was independent of whether the twoexp component was of type mpz_t, long, or int, and whether or not the bf objects also contained an internal BL bitlength component of type long (which was not present in earlier versions of this software).
With this version, bf object initialization will throw an exception with message "Request exceeds capability of this software." if mant or twoexp components exceed the bitlength threshold. Also, a limitation of Precision values to 5171655000 or less is imposed (this value is the base 10 equivalent just under a few hundred bits of the threshold). Precision values exceeding this limit in public functions will result in an exception thrown, with message "Precision can be no larger than 5171655000.". In situations where internal processing might require that Precision values be increased by a substantial amount, the limit is checked and an exception is thrown, typically wth the same message, if the revised Precision exceeds that limit.
Created and implemented the precise x.Multiply(y) functions for x of type bf, bcr, and bcp and y of various integer types. Updated the multiplication operators (x * y) to use this function if x or y is of an integer type (and unsigned, if x or y is of type bcp).
Updated the other x.Multiply and the x.Square functions to truncate results within these functions before creating output, rather than creating output and then calling x.Truncate. This avoids needlessly creating a temporary bf object which could easily exceed the bitlength limitation discussed above.
Revisited x.Euler and x.Bernoulli and reversed some rather recent changes which resulted in outputs with precision below that which was requested.
Revisited x.BesselJ and found that results can have less than requested Precision if inputs are computed with insufficient precision.
Made public the bcr function RadiusSquared and the static bf functions DegreesToRadians, GradiansToRadians, RadiansToDegrees, and RadiansToGradians.
Removed the restriction on bf function x.Exp where x needed to be less than about 1.E+1035. It turns out, after the x.Multiply and x.Square changes discussed, that x can be much larger and x.Exp still works.
Removed the code which threw out-of-memory exceptions. The restriction on bitlengths discussed above handles crash problems much better, and the underlying software usually handles memory requirements quite well enough.
Corrected an error in x.toString and x.Round in which results equal one were returned if x near one but farther away as required by rounding to Precision.
Checks for arithmetic overflow or underflow are again compiler-included in this release.
- Mpir.NET (>= 0.4.0)
This package is not used by any popular GitHub repositories.