{"id":19118576,"url":"https://github.com/dkosmari/libxint","last_synced_at":"2026-06-03T09:30:21.794Z","repository":{"id":230805176,"uuid":"616513313","full_name":"dkosmari/libxint","owner":"dkosmari","description":"libxint is a C++20 headers-only library for fixed-width large integers.","archived":false,"fork":false,"pushed_at":"2024-04-01T03:20:26.000Z","size":497,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-03T07:34:33.595Z","etag":null,"topics":["cpp","cpp20"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dkosmari.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null}},"created_at":"2023-03-20T14:32:49.000Z","updated_at":"2024-04-01T03:05:28.000Z","dependencies_parsed_at":"2024-04-01T03:43:26.370Z","dependency_job_id":"40fc2d8e-b183-4aa5-8cff-f4565b65df11","html_url":"https://github.com/dkosmari/libxint","commit_stats":null,"previous_names":["dkosmari/libxint"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkosmari%2Flibxint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkosmari%2Flibxint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkosmari%2Flibxint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkosmari%2Flibxint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dkosmari","download_url":"https://codeload.github.com/dkosmari/libxint/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240171747,"owners_count":19759415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cpp20"],"created_at":"2024-11-09T05:07:01.858Z","updated_at":"2026-06-03T09:30:21.715Z","avatar_url":"https://github.com/dkosmari.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"libxint - a C++ library for extended size unsigned integers\n===========================================================\n\nThis is a headers-only C++20 library to emulate large fixed-size integers.\nIt's licensed under the GPLv3+ license.\n\n\nInstallation\n------------\n\nWhen building from a tarball,  you can skip step 0.\n\n  0. `./bootstrap`\n\n  1. `./configure`\n\n  2. `make`\n\n  3. `sudo make install`\n\n\nTo uninstall:\n\n    sudo make uninstall\n\n\nThis is a standard Automake package; run `./configure --help` or check `INSTALL` for more\ndetails.\n\n\nUsage\n-----\n\nFirst, include the header `libxint/uint.hpp` in your program.\nThe type `xint::uint\u003cB\u003e` is now available; the template argument `B` is the number\nof desired bits. It can be used as any ordinary unsigned integer:\n\n```cpp\n#include \u003ciostream\u003e\n#include \u003clibxint/uint.hpp\u003e\n\nusing namespace std;\nusing namespace xint::literals;\n\nint main()\n{\n    xint::uint\u003c1024\u003e x = 42;\n    cout \u003c\u003c x \u003c\u003c endl;\n    x \u003c\u003c= 1000;\n    cout \u003c\u003c x \u003c\u003c endl;\n    ++x;\n    cout \u003c\u003c x \u003c\u003c endl;\n    cout \u003c\u003c popcount(x) \u003c\u003c endl;\n    auto y = 0xdeadbeef0000babecafe0000dec0de_uint;\n    cout \u003c\u003c hex \u003c\u003c y \u003c\u003c dec \u003c\u003c \" has \" \u003c\u003c y.num_bits \u003c\u003c \" bits.\" \u003c\u003c endl;\n}\n```\n\n\nImplementation details\n----------------------\n\nThis extended integer is implemented through multiple native integers, called limbs.\nThe size of each limb can be controlled by defining the `XINT_LIMB_SIZE` macro. Valid\nsizes are 8, 16 and 32 (default is 32.) For instance:\n\n    g++ -std=c++20 -DXINT_LIMB_SIZE=16 my-program.cpp\n\nThe limbs can be accessed directly through the `limbs()` and `limb(i)` member functions.\n\nNOTE: it's not possible to specify a bit size that is not a multiple of the limb size. No\nattempt is made to mask out the \"excess\" bits (for performance reasons) so the results of\nall operations will be inconsistent. A `static_assert()` exists to prevent invalid limb\nsizes.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkosmari%2Flibxint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdkosmari%2Flibxint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkosmari%2Flibxint/lists"}