Skip to content

Conversation

@mborland
Copy link
Member

Closes: #885

@mborland
Copy link
Member Author

@ckormanyos since this PR is already a monster I think I'm going to merge it once it turns green, and then do the integration work into a separate PR. There is also some demand for a boost library containing just a u128 and i128. I think it would be pretty easy to copy-paste this into such a thing.

@ckormanyos
Copy link
Member

This is, indeed, a lot of work and I need to catch up.

There is also some demand for a boost library containing just a u128 and i128. I think it would be pretty easy to copy-paste this into such a thing.

I believe so. We have considered this in some form or another in numerous offline chats. I guess (u)int128 would be something like a prerequisite for (not only this, but also other) library(ies).

In the old days, we did some work with float128 in both math and multiprecision without going the formal route for a full-on library. It might be an option to make (u)int128 in an optimized form be something within a larger context of an existing header-only library?

@mborland
Copy link
Member Author

This is, indeed, a lot of work and I need to catch up.

There is also some demand for a boost library containing just a u128 and i128. I think it would be pretty easy to copy-paste this into such a thing.

I believe so. We have considered this in some form or another in numerous offline chats. I guess (u)int128 would be something like a prerequisite for (not only this, but also other) library(ies).

In the old days, we did some work with float128 in both math and multiprecision without going the formal route for a full-on library. It might be an option to make (u)int128 in an optimized form be something within a larger context of an existing header-only library?

I had previously talked with Peter Dimov about adding uint128 and int128 to core, but since this PR and an equivalent int128 would take over 11,000 lines he thinks it's best separate. A few others have said the same since these additions would be an almost 50% increase in the size of core.

@codecov
Copy link

codecov bot commented Mar 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.9%. Comparing base (8683e33) to head (8fdeb39).
Report is 2 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop    #887     +/-   ##
=========================================
+ Coverage     98.9%   98.9%   +0.1%     
=========================================
  Files          235     236      +1     
  Lines        16955   16957      +2     
  Branches      1822    1822             
=========================================
+ Hits         16768   16770      +2     
  Misses         187     187             
Files with missing lines Coverage Δ
...lude/boost/decimal/detail/integer_search_trees.hpp 96.7% <ø> (ø)
include/boost/decimal/detail/io.hpp 100.0% <ø> (ø)
include/boost/decimal/detail/power_tables.hpp 100.0% <ø> (ø)
test/benchmark_uints.cpp 100.0% <100.0%> (ø)
test/test_zeta.cpp 100.0% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8683e33...8fdeb39. Read the comment docs.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mborland
Copy link
Member Author

@ckormanyos do you want me to wait till you have a chance to look at this before merging? It's not really stopping anything since I am now looking into SIMD for u256.

@ckormanyos
Copy link
Member

@ckormanyos do you want me to wait till you have a chance to look at this before merging?

Thank you Matt (@mborland). This was a very large effort on your part. I've followed it at least insofar as I could. I think it is cool and I like the Knuth long-div adaption.

Whenever you are OK with it, I'm fine with it.

@mborland
Copy link
Member Author

This work is being ported into the repo: https://github.com/cppalliance/int128 for broader use.

@mborland mborland closed this Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rework u128

3 participants