{"id":3585164,"name":"github.com/reddec/apd","ecosystem":"go","description":"Package apd implements arbitrary-precision decimals.\n\napd implements much of the decimal specification from the General\nDecimal Arithmetic (http://speleotrove.com/decimal/) description, which\nis refered to here as GDA. This is the same specification implemented by\npythons decimal module (https://docs.python.org/2/library/decimal.html)\nand GCCs decimal extension.\n\nPanic-free operation. The math/big types don’t return errors, and instead\npanic under some conditions that are documented. This requires users to\nvalidate the inputs before using them. Meanwhile, we’d like our decimal\noperations to have more failure modes and more input requirements than the\nmath/big types, so using that API would be difficult. apd instead returns\nerrors when needed.\n\nSupport for standard functions. sqrt, ln, pow, etc.\n\nAccurate and configurable precision. Operations will use enough internal\nprecision to produce a correct result at the requested precision. Precision\nis set by a \"context\" structure that accompanies the function arguments,\nas discussed in the next section.\n\nGood performance. Operations will either be fast enough or will produce an\nerror if they will be slow. This prevents edge-case operations from consuming\nlots of CPU or memory.\n\nCondition flags and traps. All operations will report whether their\nresult is exact, is rounded, is over- or under-flowed, is subnormal\n(https://en.wikipedia.org/wiki/Denormal_number), or is some other\ncondition. apd supports traps which will trigger an error on any of these\nconditions. This makes it possible to guarantee exactness in computations,\nif needed.\n\nSQL scan and value methods are implemented. This allows the use of Decimals as\nplaceholder parameters and row result Scan destinations.\n\napd has two main types. The first is Decimal which holds the values of\ndecimals. It is simple and uses a big.Int with an exponent to describe\nvalues. Most operations on Decimals can’t produce errors as they work\ndirectly on the underlying big.Int. Notably, however, there are no arithmetic\noperations on Decimals.\n\nThe second main type is Context, which is where all arithmetic operations\nare defined. A Context describes the precision, range, and some other\nrestrictions during operations. These operations can all produce failures,\nand so return errors.\n\nContext operations, in addition to errors, return a Condition, which is a\nbitfield of flags that occurred during an operation. These include overflow,\nunderflow, inexact, rounded, and others. The Traps field of a Context can be\nset which will produce an error if the corresponding flag occurs. An example\nof this is given below.","homepage":"https://github.com/reddec/apd","licenses":"Apache-2.0","normalized_licenses":["Apache-2.0"],"repository_url":"https://github.com/reddec/apd","keywords_array":[],"namespace":"github.com/reddec","versions_count":2,"first_release_published_at":"2017-09-12T20:59:01.000Z","latest_release_published_at":"2018-07-27T00:43:39.000Z","latest_release_number":"v1.1.0","last_synced_at":"2026-05-29T04:31:10.095Z","created_at":"2022-04-11T04:36:03.743Z","updated_at":"2026-05-29T04:31:10.095Z","registry_url":"https://pkg.go.dev/github.com/reddec/apd","install_command":"go get github.com/reddec/apd","documentation_url":"https://pkg.go.dev/github.com/reddec/apd#section-documentation","metadata":{},"repo_metadata":{"id":57502169,"uuid":"160526554","full_name":"reddec/apd","owner":"reddec","description":"Arbitrary-precision decimals for Go","archived":false,"fork":true,"pushed_at":"2019-03-29T08:03:50.000Z","size":808,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-12T05:05:42.706Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/cockroachdb/apd","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"cockroachdb/apd","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reddec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-05T13:59:32.000Z","updated_at":"2019-03-29T08:03:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/reddec/apd","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/reddec/apd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fapd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fapd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fapd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fapd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reddec","download_url":"https://codeload.github.com/reddec/apd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fapd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279015920,"owners_count":26085778,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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"},"owner_record":{"login":"reddec","name":"Aleksandr Baryshnikov","uuid":"6597086","kind":"user","description":"","email":"","website":"https://reddec.net/","location":"Singapore","twitter":null,"company":null,"icon_url":"https://avatars.githubusercontent.com/u/6597086?u=79d84817075b2e958e54f224e784b86afa618599\u0026v=4","repositories_count":154,"last_synced_at":"2025-10-12T05:05:39.527Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/reddec","funding_links":[],"total_stars":1277,"followers":86,"following":34,"created_at":"2022-11-08T15:56:14.462Z","updated_at":"2025-10-12T05:05:39.527Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reddec","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reddec/repositories"},"tags":[{"name":"v2.0.0","sha":"bced77f817b446cc6f6453d6cab5891e43f9ba17","kind":"commit","published_at":"2018-10-17T18:11:44.000Z","download_url":"https://codeload.github.com/reddec/apd/tar.gz/v2.0.0","html_url":"https://github.com/reddec/apd/releases/tag/v2.0.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/reddec/apd@v2.0.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fapd/tags/v2.0.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fapd/tags/v2.0.0/manifests"},{"name":"v1.1.0","sha":"9c2ab8efc9ac66bf4bb79ab6bed4dcd0c709d1b9","kind":"commit","published_at":"2018-07-27T00:43:39.000Z","download_url":"https://codeload.github.com/reddec/apd/tar.gz/v1.1.0","html_url":"https://github.com/reddec/apd/releases/tag/v1.1.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/reddec/apd@v1.1.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fapd/tags/v1.1.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fapd/tags/v1.1.0/manifests"},{"name":"v1.0.0","sha":"b1ce49cb2a474f4416531e7395373eaafaa4fbe2","kind":"commit","published_at":"2017-09-12T20:59:01.000Z","download_url":"https://codeload.github.com/reddec/apd/tar.gz/v1.0.0","html_url":"https://github.com/reddec/apd/releases/tag/v1.0.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/reddec/apd@v1.0.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fapd/tags/v1.0.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fapd/tags/v1.0.0/manifests"}]},"repo_metadata_updated_at":"2025-10-13T15:25:04.261Z","dependent_packages_count":0,"downloads":null,"downloads_period":null,"dependent_repos_count":0,"rankings":{"downloads":null,"dependent_repos_count":9.345852080216646,"dependent_packages_count":6.999148183520997,"stargazers_count":null,"forks_count":null,"average":8.172500131868823},"purl":"pkg:golang/github.com/reddec/apd","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/go/github.com/reddec/apd","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/go/github.com/reddec/apd","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/go/github.com/reddec/apd/dependencies","status":null,"funding_links":[],"critical":null,"issue_metadata":{"last_synced_at":"2023-08-12T03:05:05.135Z","issues_count":0,"pull_requests_count":0,"avg_time_to_close_issue":null,"avg_time_to_close_pull_request":null,"issues_closed_count":0,"pull_requests_closed_count":0,"pull_request_authors_count":0,"issue_authors_count":0,"avg_comments_per_issue":null,"avg_comments_per_pull_request":null,"merged_pull_requests_count":0,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":0,"past_year_pull_requests_count":0,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":null,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":0,"past_year_pull_request_authors_count":0,"past_year_issue_authors_count":0,"past_year_avg_comments_per_issue":null,"past_year_avg_comments_per_pull_request":null,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":0,"issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/reddec%2Fapd/issues","maintainers":[],"active_maintainers":[]},"versions_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Freddec%2Fapd/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Freddec%2Fapd/version_numbers","latest_version_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Freddec%2Fapd/latest_version","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Freddec%2Fapd/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Freddec%2Fapd/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/proxy.golang.org/packages/github.com%2Freddec%2Fapd/codemeta","maintainers":[]}