{"id":21199175,"url":"https://github.com/r167/pi_calc","last_synced_at":"2026-07-09T11:31:18.815Z","repository":{"id":15501330,"uuid":"18235299","full_name":"R167/pi_calc","owner":"R167","description":"Several ruby pi calculators","archived":false,"fork":false,"pushed_at":"2014-03-29T17:07:10.000Z","size":148,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T10:36:27.556Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/R167.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":"2014-03-29T05:39:26.000Z","updated_at":"2014-03-29T17:07:08.000Z","dependencies_parsed_at":"2022-09-14T08:02:00.058Z","dependency_job_id":null,"html_url":"https://github.com/R167/pi_calc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R167%2Fpi_calc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R167%2Fpi_calc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R167%2Fpi_calc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/R167%2Fpi_calc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/R167","download_url":"https://codeload.github.com/R167/pi_calc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243653485,"owners_count":20325749,"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-20T19:59:34.370Z","updated_at":"2025-10-30T09:51:26.319Z","avatar_url":"https://github.com/R167.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Pi Calc\n=======\n\nThis is just a collection of several ruby pi calculators that I wrote for personal entertainment.\nFor those who are curious, everything is under the ```PiCalc``` module.\n\nFunctions\n---------\n\nThe ```PiCalc``` module includes 3 ways to calculate pi.\n\nThey use a variety of different methods to calculate pi. All of them have a standard ```total``` value that can be set to determine the number of iterations, and hence the accuracy of the output. ```total``` defaults to 100,000\n\n```ruby\nrequire 'pi_calc'\n\n# The Gregory-Leibniz series\nPiCalc.gregory_leibniz\n# =\u003e 3.1415826535897198\n\n# The Nilakantha series\nPiCalc.nilakantha\n# =\u003e 3.1415926535897865\n\n# The Buffon's needle tactic (not the same each time)\nPiCalc.buffons_needle\n# =\u003e 3.1600069520152942\n\n# Slightly faster Buffon's needle tactic\nPiCalc.buffons_needle_optimized\n\n# Testing the speeds\nPiCalc.test\n```\n\nFor more deph on how each part of the code works, read the source code.\n\n[![Gem Version](https://badge.fury.io/rb/pi_calc.png)](http://badge.fury.io/rb/pi_calc)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr167%2Fpi_calc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr167%2Fpi_calc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr167%2Fpi_calc/lists"}