{"id":16635816,"url":"https://github.com/ythecombinator/gammafn","last_synced_at":"2025-08-28T12:19:22.986Z","repository":{"id":88818016,"uuid":"99546251","full_name":"ythecombinator/GammaFn","owner":"ythecombinator","description":"🔢 Gamma function (Γ) from mathematics in Swift.","archived":false,"fork":false,"pushed_at":"2017-08-16T03:49:40.000Z","size":53,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-12T06:12:16.614Z","etag":null,"topics":["approximation","factorial","gamma","lanczos","mathematics"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/ythecombinator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"publiccode":null,"codemeta":null}},"created_at":"2017-08-07T06:51:29.000Z","updated_at":"2024-01-06T18:54:11.000Z","dependencies_parsed_at":"2023-06-12T19:00:40.993Z","dependency_job_id":null,"html_url":"https://github.com/ythecombinator/GammaFn","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"09d2a29beb286c2f309fde835da17940a9d78808"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ythecombinator/GammaFn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ythecombinator%2FGammaFn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ythecombinator%2FGammaFn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ythecombinator%2FGammaFn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ythecombinator%2FGammaFn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ythecombinator","download_url":"https://codeload.github.com/ythecombinator/GammaFn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ythecombinator%2FGammaFn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272498221,"owners_count":24944819,"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-08-28T02:00:10.768Z","response_time":74,"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"}},"keywords":["approximation","factorial","gamma","lanczos","mathematics"],"created_at":"2024-10-12T06:04:56.575Z","updated_at":"2025-08-28T12:19:22.574Z","avatar_url":"https://github.com/ythecombinator.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n\t\u003cimg src=\"Docs/Images/banner.png\" alt=\"Logo\" width=\"800px\"\u003e\n\t\u003cbr\u003e\n\t\u003cbr\u003e\n\u003c/h1\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n\t🔢 gamma function (Γ) from mathematics in Swift 🔢\n\u003cbr\u003e\n\u003cbr\u003e\n\n\u003ca href=\"https://swift.org\"\u003e\n    \u003cimg src=\"http://img.shields.io/badge/swift-3.1-orange.svg\" alt=\"Swift 3.1\"\u003e\n\u003c/a\u003e\n\n\u003ca\u003e\n    \u003cimg src=\"https://img.shields.io/badge/platforms-Linux%20%7C%20OS%20X-blue.svg\" alt=\"Platforms\"\u003e\n\u003c/a\u003e\n\n\u003ca\u003e\n    \u003cimg src=\"https://img.shields.io/badge/package%20managers-SwiftPM-yellow.svg\" alt=\"Package Managers\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://travis-ci.org/ythecombinator/GammaFn\"\u003e\n    \u003cimg src=\"https://travis-ci.org/ythecombinator/GammaFn.svg?branch=master\" alt=\"Build Status\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://codebeat.co/projects/github-com-ythecombinator-gammafn-master\"\u003e\n    \u003cimg alt=\"codebeat badge\" src=\"https://codebeat.co/badges/8b555148-33c0-42bc-9ed1-96ddae707ad9\" /\u003e\n\u003c/a\u003e\n\n\u003ca href=\"LICENSE.md\"\u003e\n    \u003cimg src=\"http://img.shields.io/badge/license-MIT-brightgreen.svg\" alt=\"MIT License\"\u003e\n\u003c/a\u003e\n\n\u003c/p\u003e\n\u003cbr\u003e\n\n---\n\n## 📚 Table of Contents\n\n\u003c!-- DO NOT EDIT THE COMMENTS BELOW --\u003e\n\n\u003c!-- toc --\u003e\n\n- [Installation](#-installation)\n- [Getting Started](#-getting-started)\n- [License](#️-license)\n\n\u003c!-- tocstop --\u003e\n\n## 📦 Installation\n\nYou just need to add this package as a dependency in your `Package.swift`:\n\n```swift\nlet package = Package(\n    name: \"MyProject\",\n    dependencies: [\n        .Package(url: \"https://github.com/ythecombinator/GammaFn.git\", majorVersion: 1),\n        // ...\n    ]\n    // ...\n)\n```\n\n## 🚀 Getting Started\n\n### `gamma(for: Double) -\u003e Double`\n\nIt returns the gamma function over `z`.\n\n\u003e *Note*: Complex ( `ℂ` ) numbers aren't supported–only Reals ( `ℝ` ).\n\n```swift\nimport GammaFn\n\n// Creating a simple `Double` value which we intend to pass to our Γ function–which is a static method from `Double`:\n\nlet simpleValue1: Double = 6.0\nlet resultValue1 = Double.gamma(for value: simpleValue1)\n// =\u003e 120.0000000000002\n\n// Another valid approach is accessing the property `gammaValue` from any `Double` value:\n\nlet simpleValue2: Double = 12.0\nlet resultValue2 = simpleValue2.gammaValue\n// =\u003e 39916800.00000004\n```\n\n### `logForGamma(of: Double) -\u003e Double`\n\nIt returns the natural log of the gamma function for `z`.\n\n\u003e *Note*: This function is used internally by the [spouge approximation](https://en.wikipedia.org/wiki/Spouge's_approximation) to compute large values.\n\n```swift\nimport GammaFn\n\n// Creating a simple `Double` value which we intend to pass to our Γ function–which is a static method from `Double`:\n\nlet simpleValue3: Double = 9.0\nlet resultValue3 = Double.gamma(for value: simpleValue3)\n// =\u003e 10.64917311666183\n\n// Accessing the property `logValueForGamma` from any `Double` value is valid as well:\n\nlet simpleValue4: Double = 112.0\nlet resultValue4 = simpleValue4.logValueForGamma\n// =\u003e 415.0403783916892\n```\n\n## ⚖️ License\n\n[GammaFn](https://github.com/ythecombinator/GammaFn) is distributed under\nthe MIT License, available in this repository.\n\nAll contributions are assumed to be also licensed under the same.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fythecombinator%2Fgammafn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fythecombinator%2Fgammafn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fythecombinator%2Fgammafn/lists"}