LongCalc Arbitrary Precision Float and Complex Number Library
See the version list below for details.
Some further investigation was done into the curious output of Mpir.NET functions such as .BitLength, .IndexOfOne, etc which could return negative results. Eventually (like about now), an understanding arose as to what those values represented and how to interpret them. In previous versions my interpretation was flat-out wrong. As a results, inaccurate results for most any of the LongCalc functions were bound to happen if the Precision setting was high enough or the output values were of high enough order of magnitude.
With this version, those errors have hopefully been resolved. I have included my own x.Bitlength property function which returns a long data type whose value might be more understandable to me. The GlobalAllowAddTruncates parameter is now gone since the x.Add function problems have been resolved. bf mantissa widths up to 2 ^ long.MaxValue bits should work, and the problem of x.Floor() function failures should be over and the x.Normalize1() function problems resolved.
In addition, functions 'public static long LongVal(mpz_t x)' and 'public static mpz_t Mpz_tVal(long x)' have been added to facilitate changes between mpz_t and long data types, as Mpir.NET version 0.4.0 has difficulties with long input data for mpz_t type initialization, casts from mpz_t to long, and comparison operators or functions between mpz_t and long values.
Also, the x.Round and x.toString functions are much faster now for the most part.
In this version also: the bf, bcr, and bcp data type intializer functions which had a boolean CloneMant parameter are gone as a bad idea in the first place.
The bad news: In this version, any attempts at x.Exp for x larger than about 1.E+9 will likely bring this software to a slow-motion crash, while x.Exp in previous versions for x even as large as 6.E+18 might quickly produce results, but they are quite possibly wrong results.
Checks for arithmetic overflow or underflow are again compiler-included in this release.
- Mpir.NET (>= 0.4.0)