{"id":34115603,"url":"https://github.com/rwpenney/spfpm","last_synced_at":"2026-04-08T19:31:31.032Z","repository":{"id":31469003,"uuid":"35033008","full_name":"rwpenney/spfpm","owner":"rwpenney","description":"Package for performing fixed-point, arbitrary-precision arithmetic in Python.","archived":false,"fork":false,"pushed_at":"2024-03-02T08:03:20.000Z","size":234,"stargazers_count":66,"open_issues_count":3,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-03-14T08:12:11.647Z","etag":null,"topics":["arithmetic","fixed-point","numerical-methods","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rwpenney.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-05-04T12:17:57.000Z","updated_at":"2025-08-29T01:18:54.000Z","dependencies_parsed_at":"2024-03-02T09:23:51.243Z","dependency_job_id":"3469f56a-8bd8-4f06-ad03-0cc09e35318f","html_url":"https://github.com/rwpenney/spfpm","commit_stats":{"total_commits":69,"total_committers":5,"mean_commits":13.8,"dds":0.5217391304347826,"last_synced_commit":"17b8b56d364d8d00cef7bbb4a107b24f885fc364"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/rwpenney/spfpm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwpenney%2Fspfpm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwpenney%2Fspfpm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwpenney%2Fspfpm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwpenney%2Fspfpm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rwpenney","download_url":"https://codeload.github.com/rwpenney/spfpm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwpenney%2Fspfpm/sbom","scorecard":{"id":791434,"data":{"date":"2025-08-11","repo":{"name":"github.com/rwpenney/spfpm","commit":"13888abb48962ec90f32bb8f3666aaa926ba9e30"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T07:39:22.964Z","repository_id":31469003,"created_at":"2025-08-23T07:39:22.964Z","updated_at":"2025-08-23T07:39:22.964Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31571599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["arithmetic","fixed-point","numerical-methods","python"],"created_at":"2025-12-14T20:03:08.166Z","updated_at":"2026-04-08T19:31:31.024Z","avatar_url":"https://github.com/rwpenney.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Python Fixed-Point Module (SPFPM)\n\nspfpm is a pure-Python toolkit for performing binary fixed-point arithmetic,\nincluding trigonometric and exponential functions.\n\nThe package provides:\n* Representations of values with a fixed number of fractional bits\n* Optional constraints on the number of whole-number bits\n* Interconversion between native Python types and fixed-point objects\n* Arithmetic operations (addition, subtraction, multiplication, division)\n  of fixed-point numbers\n* Methods for computing powers, logarithms and exponents\n* Methods for computing trigonometric functions and their inverses\n* Computation of various mathematical constants, such as pi and log(2),\n  to maximal precision for the chosen fixed-point resolution\n* Printing fixed-point numbers as decimal numbers,\n  or as binary/octal/hexadecimal representations.\n* Support for numbers with thousands of bits of resolution\n\nOn a modern desktop PC, spfpm is typically capable\nof hundreds of thousands of arithmetic operations per second,\ni.e. over 100 kilo-FLOPS, even for a few hundred bits of resolution.\nAs a pure-Python library SPFPM offers portability and interactivity,\nbut will never compete with the performance of lower-level libraries\nsuch as [mpmath](http://mpmath.org/),\n[Boost multiprecision](https://www.boost.org/doc/libs/1_72_0/libs/multiprecision/doc/html/index.html)\nor [GMP](https://gmplib.org/) for heavyweight calculations.\n\nDevelopment currently targets [Python](https://www.python.org)\nversions 3.3 and later, although the library may also\nbe usable with python-2.7.\nThe latest version of spfpm can be found\non [GitHub](https://github.com/rwpenney/spfpm).\n\n\n## Examples\n\nAfter installation there are two main classes that you need\nfrom the FixedPoint module:\n\n```python\nfrom FixedPoint import FXfamily, FXnum\n```\n\nyou can create fixed-point numbers with the default (64-bit) resolution\nas follows:\n\n```python\nx = FXnum(22) / FXnum(7)\ny = FXnum(3.1415)\nprint(x - y)\n```\n\nCreating numbers with a specific precision requires use\nof the `FXfamily` class:\n\n```python\nfam100 = FXfamily(100)\nz = FXnum(1, fam100)\nz2 = fam100(2)\n```\n\nOne can then apply various computations such as:\n\n```python\nprint(z.atan() * 4)\nprint(z2.sqrt())\n```\n\nThe `FXfamily` class also provides access to pre-computed constants\nwhich should be accurate to about 1/2 of the least significant bit (LSB):\n\n```python\nprint('pi = ', fam100.pi)\nprint('log2 = ', fam100.log2)\nprint('sqrt2 = ', fam100.sqrt2)\n```\n\nThis produces the following printed values of those constants:\n\n* 3.141592653589793238462643383279\n* 0.69314718055994530941723212145 ~~7~~\n* 1.414213562373095048801688724209\n\nThe struck-through digits show where the values computed\nat 100-bit precision differ from the true digits in\nthe decimal representations of these constants.\nAlternatively, one could print these values in base-16:\n\n```python\nprint(FXfamily(400).pi.toBinaryString(logBase=4))\n```\n\ngiving a hexadecimal value of Pi as:\n\n* 3.243f6a8885a308d313198a2e03707344a4093822299f31d0082efa98ec4e6c89452821e638d01377be5466cf34e90c6cc0ac\n\nwhich agrees exactly with\nthe [accepted result](http://hexpi.sourceforge.net/).\n\n\n## Licensing\n\nAll files are released under\nthe [Python PSF License](https://docs.python.org/3/license.html)\nand are Copyright 2006-2024 RW Penney.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwpenney%2Fspfpm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frwpenney%2Fspfpm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwpenney%2Fspfpm/lists"}