Cannot set Precision using boost multiprecision

Pages: 12
@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, allegations?
Flesh wrote:
Your definition of help and mine are not the same, my question should not be that hard, it is not a trick question

Yes, well, your definition of help appears to be “make the universe unwind to work the way I think it ought”.

You’ll get along better in life if your definition of help aligns more with “I am having difficulty understanding something. This is what I think. What can I do to correct that mis-think and learn more?”

@MikeStgt
Dude, your head is so far up your butt it is pathetic.

Duthomhas wrote:
They use a radix of...
Duthomhas wrote:
Store each element of the bignum as a word, and [you] use a radix like, oh, say, 65536.


The only thing I can’t explain is your love of strawman BS.

Could you pls explain the discrepancy about the radix specification (mostly 2) shown in the Boost.Multiprecision documentation referenced here:
Hmm. I spent several long posts doing just that, repeating myself with different little words each time.

Rant and gnash your teeth all you like. This topic is now on my ignore list.


I can do nothing for people who cannot be helped.
Why are you so upset? Why don't you show the source of your statements? A link to Wikipedia, a link to a documentation of a bignum lib? In your post http://www.cplusplus.com/forum/general/251744/#msg1108403 you refuse to do so: "I do not feel obligated to explain." But you should if you allege something contrary to Boost.Multiprecision documentation.

Otherwise all of your "several long posts doing just that" are IMO unreliable. Instead of disentangle the discrepancy in your lenghty posts you tend to unpolite words far off topic.

No problem -- I know now how to assess your kind of expertise.

Back to the subject:
To all others still interested in facts, due to the documentation all but one of the types (integer, floating-point, complex, rational) used by Boost.Multiprecision base on a radix of 2. See the links given for every kind of type in this append: http://www.cplusplus.com/forum/general/251744/#msg1108436

Edit: corrected a typo, 'his' is not 'this' :)
Last edited on
closed account (z05DSL3A)
MikeStgt wrote:
Why are you so upset?
You seem to have a knack of winding people up, I have wondered if it is deliberate or accidental.
@Grey Wolf
For sure not deliberate, for me there is no gain with it. I am interested in the subject, not in sensitivities. What is your recommendation how to deal with doubtful or obviously wrong information?
@Grey Wolf
Sure you want to join in here? lastchance did the most sensible thing and left.

I have wondered if it is deliberate or accidental

It’s deliberate. MikeStgt has followed me around several topics, cherry-picking pieces of text to try to twist up into absurdist rubbish.

I have a running theory about him... but I could be wrong...

Anyway, here’s a bonus for you, just for joining this (dead) topic!

https://www.youtube.com/watch?v=SqDP8SnPVA0
closed account (z05DSL3A)
MikeStgt, I would recommend being less confrontational. Remember that text on a screen has limited ability convey the non-verbal communication.
@Grey Wolf
Ok, we have a "little" subject drift now, it's about non-verbal communication.

I agree with you about the limited ability of interchange in written. The appends in this list are not of the grade as contracts waterproof in all contingencies, it's rather some gossip at a regulars' table -- if it's about opinions, point of views, ideas.

On the contrary if it is about facts. IMO we should use them as a concerted common basis for all communication. Otherwise we drift into the vast field of beliefs, source of misapprehension and tendentious to quarrel. We should try to avoid it by accepting as evidence, that facts do not disappear if you close your eyes.

Now to the single case here. You recommend being less confrontational. First I remarked that I am not convinced. I did not shout "wrong!". My next hint was I doubt (a bit more plain than just not convinced). So I insisted on a purposeful answer. Is it this what you perceive as "confrontational" or "a knack of winding people up"? Sure, I could have realized earlier that more questions are usesles. So it's me who pulled it to the glare of the sun what smells fishy -- and have to vindicate now?

We are humans and don't like to be caught making errors. I took the time for a lenghty reply far off C++ as I'd like to continue to learn about the facts of C++ with this list. I do not like too much ambient noise or bandwidth.
closed account (z05DSL3A)
MikeStgt wrote:
Now to the single case here...
I'm only talking in general terms of your overall interactions in the forum.
and wrote:
I do not like too much ambient noise or bandwidth.
that is probably one of the things that comes across...and it is easily interpreted as argumentative or something else. I value terseness but understand that it can seem rude or unfriendly and so make effort to be friendly while still being succinct or concise.

This is just an impartial view, you can take it or leave it...and the last I'll say on it here.
Topic archived. No new replies allowed.
Pages: 12