{"id":18598454,"url":"https://github.com/backendtea/safe-bc-math","last_synced_at":"2025-07-18T17:03:32.890Z","repository":{"id":62491089,"uuid":"249190375","full_name":"BackEndTea/safe-bc-math","owner":"BackEndTea","description":"Safe(r) BC Math functions for PHP","archived":false,"fork":false,"pushed_at":"2020-03-22T13:46:35.000Z","size":6,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-16T03:08:05.438Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BackEndTea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-22T13:34:45.000Z","updated_at":"2021-10-05T19:12:08.000Z","dependencies_parsed_at":"2022-11-02T11:16:19.380Z","dependency_job_id":null,"html_url":"https://github.com/BackEndTea/safe-bc-math","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/BackEndTea/safe-bc-math","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BackEndTea%2Fsafe-bc-math","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BackEndTea%2Fsafe-bc-math/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BackEndTea%2Fsafe-bc-math/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BackEndTea%2Fsafe-bc-math/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BackEndTea","download_url":"https://codeload.github.com/BackEndTea/safe-bc-math/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BackEndTea%2Fsafe-bc-math/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265797935,"owners_count":23829857,"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":[],"created_at":"2024-11-07T01:32:46.185Z","updated_at":"2025-07-18T17:03:32.828Z","avatar_url":"https://github.com/BackEndTea.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Safe BC Math\n\n## Installation\n\n```bash\n$ composer require backendtea/safe-bc-math\n```\n\n## Why this package\n\nCasting a float to a string does not always do what you think it does.\nSome locales may give unexpected results, and give a malformed string, or\nthe number is cast to a scientific notationm for example: `1.0E-11`. Which bcmath cant handle.\nEven if you do not manually cast it to a string, the bc math functions expect strings, and will cast it themselves.\n\nThis package will throw an exception telling you what error it encountered, instead of giving a\nwarning `bcmath function argument is not well-formed` and returning a wrong error.\n\n## Usage\n\nReplace any usage of bc math functions with the `Backendtea\\bc..` version.\n\ne.g.\n\n```diff\n- bcadd($a, $b);\n+ \\BackEndTea\\bcadd($a, $b);\n```\n\nOr even better, import the funtion:\n\n```diff\n+ use function BackEndTea\\bcadd;\n\nbcadd($a, $b);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackendtea%2Fsafe-bc-math","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbackendtea%2Fsafe-bc-math","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackendtea%2Fsafe-bc-math/lists"}