{"id":43756502,"url":"https://github.com/phpmath/biginteger","last_synced_at":"2026-02-05T14:31:26.757Z","repository":{"id":29609515,"uuid":"33149881","full_name":"phpmath/biginteger","owner":"phpmath","description":"A PHP library to work with big integers.","archived":false,"fork":false,"pushed_at":"2025-09-05T08:04:15.000Z","size":135,"stargazers_count":22,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-06T19:17:19.842Z","etag":null,"topics":["biginteger","math","mathematics","php7"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phpmath.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-30T21:42:17.000Z","updated_at":"2025-11-06T04:00:37.000Z","dependencies_parsed_at":"2022-09-03T14:50:34.250Z","dependency_job_id":null,"html_url":"https://github.com/phpmath/biginteger","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/phpmath/biginteger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpmath%2Fbiginteger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpmath%2Fbiginteger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpmath%2Fbiginteger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpmath%2Fbiginteger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpmath","download_url":"https://codeload.github.com/phpmath/biginteger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpmath%2Fbiginteger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29123675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T14:05:12.718Z","status":"ssl_error","status_checked_at":"2026-02-05T14:03:53.078Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["biginteger","math","mathematics","php7"],"created_at":"2026-02-05T14:31:26.007Z","updated_at":"2026-02-05T14:31:26.749Z","avatar_url":"https://github.com/phpmath.png","language":"PHP","readme":"# biginteger\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Software License][ico-license]](LICENSE)\n[![Total Downloads][ico-downloads]][link-downloads]\n\nA PHP library to work with big integers. This library makes use of the GMP extension to\ndo its calculations.\n\n## Install\n\nVia Composer\n\n``` bash\n$ composer require phpmath/biginteger\n```\n\n## Usage\n\nThere are two ways to create a BigInteger. A mutable or immutable BigInteger.\n\n``` php\n$number = new PHP\\Math\\BigInteger\\MutableBigInteger('8273467836243255543265432745');\n$number = new PHP\\Math\\BigInteger\\ImmutableBigInteger('8273467836243255543265432745');\n```\n\n```php\n$a = new PHP\\Math\\BigInteger\\ImmutableBigInteger('12345678901234567890');\n$b = new PHP\\Math\\BigInteger\\ImmutableBigInteger('98765432109876543210');\n\n$sum = $a-\u003eadd($b);\n\necho $sum-\u003evalue();\n```\n\n## Features\n\nThis library provides a wide range of operations for working with big integers using the GMP extension:\n\n### Basic Arithmetic\n- Add, subtract, multiply, and divide large numbers.\n- Calculate powers and roots of numbers.\n- Perform modulo operations.\n- Negate numbers and get absolute values.\n\n### Comparison\n- Compare numbers using `cmp()` and check equality with `equals()`.\n- Determine the sign of a number (positive, negative, or zero).\n\n### Bitwise Operations\n- Perform bitwise AND, OR, XOR, and NOT operations.\n- Compute Hamming distance between numbers.\n\n### Number Theory\n- Calculate factorials.\n- Check if numbers are prime or likely prime.\n- Compute modular inverses.\n- Compute Jacobi, Legendre, and Kronecker symbols.\n- Calculate greatest common divisors (GCD) and least common multiples (LCM).\n- Check for perfect squares and perfect powers.\n- Find the next prime number.\n- Compute binomial coefficients.\n\n\n## Change log\n\nWe keep a changelog for every release, have a look at the [releases overview][link-releases-overview].\n\n## Testing\n\n``` bash\n$ composer test\n```\n\nTo generate code coverage:\n\n``` bash\n$ composer test-coverage\n```\n\n## Contributing\n\nAll contributions are welcome. Feel free to create a PR or open an issue.\n\n## Security\n\nIf you discover any security related issues, please create an issue in the issue tracker.\n\n## Credits\n\n- [Walter Tamboer][link-author]\n- [All Contributors][link-contributors]\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/phpmath/biginteger.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/phpmath/biginteger.svg?style=flat-square\n\n[link-packagist]: https://packagist.org/packages/phpmath/biginteger\n[link-downloads]: https://packagist.org/packages/phpmath/biginteger/stats\n[link-author]: https://github.com/waltertamboer\n[link-contributors]: ../../contributors\n[link-releases-overview]: https://github.com/phpmath/biginteger/releases\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpmath%2Fbiginteger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpmath%2Fbiginteger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpmath%2Fbiginteger/lists"}