I'm working with __int128
s in g++ and need to print them. I found this question: How to print __int128 in g++? but it is 6 years old: is there a better way to do it in modern c++?
Asked
Active
Viewed 352 times
2

lolad
- 321
- 6
- 13
-
It seems that C++ still does not provide support for it. So that answer still stands. – anastaciu Oct 07 '20 at 20:43
-
I mean, the algorithms they used, is there a nicer way of doing them now? – lolad Oct 07 '20 at 20:44
-
There are two answers from last year, and two answers from _this_ year... – Asteroids With Wings Oct 07 '20 at 20:57
-
The idea is to convert the value to a string, you can have a more or less elegant way to do it but that's basically it. – anastaciu Oct 07 '20 at 20:57
-
1"*is there a nicer way*" I don't think so, it's still "divide by 10 and repeat"... – rustyx Oct 07 '20 at 21:33
-
2For what it's worth, here's Google's answer: https://github.com/abseil/abseil-cpp/blob/master/absl/numeric/int128.cc#L212 – parktomatomi Oct 08 '20 at 01:03