@Flesh
Myself back from hospital I feel sorry about your cancer, but I also feel sorry about you "made for peace" in the Air Force. But I have to see the world as it is and as an enthusiast of pocket calculators I have to face their success is based on CORDIC first used for -- you know it:
https://en.wikipedia.org/wiki/CORDIC
But this is a C++ forum, back to the subject:
numerical math isn't, and computing is integer math with a convention where to spot the decimal separator. If you take a look at Numerical analysis --
https://en.wikipedia.org/wiki/Numerical_analysis -- it's about approximation, round-off, truncation and discretization error and more problems. Example: a circle, draw it by hand or a pair of compasses, compute it with as many digits you can afford, you never will match the definition of a circle:
x2 + y2 = r2
This said, if you compute with more digits, it is
just for fun. If you "know" Pi with 15 digits or 1015 or much more digits, you are still as far away from "real" Pi as with 10 digits.
For the sake of fun (it has nothing to do with C++): Wikipedia about
arbitrary-precision arithmetic --
https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic -- is referencing REXX. IMO it offers what you are looking for, the only datatype is string and you may set the numeric digits at will (up to the storage limits). Example:
1 2 3 4 5
|
/* Many Digits Demo */
say 1/3
numeric digits 50
say 1/3
exit
|
shows
0.333333333
0.33333333333333333333333333333333333333333333333333 |
(REXX is well known from IBM mainframes, on PCs sice IBM DOS 7 (not so fast) and bREXX (fast) from Vasilis Vlachoudis (CERN). I suggest ooREXX (pretty fast) as it offers in addition programming with objects if you like (I do not) and multithreading. {Fast or not so fast, speed is not comparable to compiled C/C++})
Now to somethng completely different: C++
@Duthomhas
Apr 2, 2019 at 3:08am:
They use a radix of some multiple of 8 bytes. In this case, a radix of slightly under 65535. |
Apr 2, 2019 at 7:39pm:
Store each element of the bignum as a word, and use a radix like, oh, say, 65536. |
Is this a flagrant contradiction or a nugatory typo? Could you pls explain the discrepancy about the radix specification (mostly
2) shown in the Boost.Multiprecision documentation referenced here:
http://www.cplusplus.com/forum/general/251744/#msg1108436
and your allegation? Ah, no, allegation
s?