{"id":24475036,"url":"https://github.com/rufflewind/sci-ratio","last_synced_at":"2025-12-29T10:05:14.399Z","repository":{"id":19493382,"uuid":"22739491","full_name":"Rufflewind/sci-ratio","owner":"Rufflewind","description":"Parsing and pretty-printing of exact rational numbers with arbitrarily large exponents.","archived":false,"fork":false,"pushed_at":"2021-06-07T06:05:27.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-07-14T09:21:46.718Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","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/Rufflewind.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":"2014-08-07T23:17:33.000Z","updated_at":"2021-06-07T06:05:30.000Z","dependencies_parsed_at":"2022-09-11T16:01:33.591Z","dependency_job_id":null,"html_url":"https://github.com/Rufflewind/sci-ratio","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rufflewind%2Fsci-ratio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rufflewind%2Fsci-ratio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rufflewind%2Fsci-ratio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rufflewind%2Fsci-ratio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rufflewind","download_url":"https://codeload.github.com/Rufflewind/sci-ratio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243602258,"owners_count":20317599,"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":"2025-01-21T09:12:02.946Z","updated_at":"2025-12-29T10:05:14.328Z","avatar_url":"https://github.com/Rufflewind.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"sci-ratio [![Build status][ci]][ca]\n=================================\n\n**Quick links:** [installation](#installation), [documentation][doc],\n[versioning policy][pvp].\n\nThis package provides utilities for parsing and pretty-printing exact rational\nnumbers with arbitrarily large exponents.  Numbers are represented using the\n`SciRatio a b` type, which can be thought of as a rational number combined\nwith a power of ten:\n\n```\nr .^ e == r * 10 ^^ e\n```\n\nThe primary advantage of this data type is that it's capable of storing\nextremely large exponents without issues, although *performing arithmetic* on\nthem is not guaranteed to be efficient in some cases (e.g. adding numbers with\nwildly differing exponents).\n\nThe parsers accept a wide variety of formats:\n\n```hs\n\u003e readSciRational \"-0.0e+3\"         -- result: Just ((0 % 1) .^ 0)\n\u003e readSciRational \"0.25e+2\"         -- result: Just ((25 % 1) .^ 0)\n\u003e readSciRational \"-1.0e-1\"         -- result: Just (((-1) % 1) .^ (-1))\n\u003e readSciRational \"5.0e+20/6.e0\"    -- result: Just ((25 % 3) .^ 19)\n\u003e readSciRational \"0xfeedface\"      -- result: Just ((4277009102 % 1) .^ 0)\n\u003e readSciRational \"1e99999999\"      -- result: Just ((1 % 1) .^ 99999999)\n```\n\nNumbers can be pretty-printed in a compact format:\n\n```hs\n\u003e showSciRational (-0.0e+3)         -- result: \"0\"\n\u003e showSciRational (0.25e+2)         -- result: \"25\"\n\u003e showSciRational (-1.0e-1)         -- result: \"-.1\"\n\u003e showSciRational (5.0e+20 / 6)     -- result: \"2.5e20/3\"\n\u003e showSciRational (0xfeedface)      -- result: \"4277009102\"\n\u003e showSciRational (1 .^ 99999999)   -- result: \"1e99999999\"\n```\n\nInstallation\n------------\n\nThe package is available on [Hackage][doc]:\n\n```sh\ncabal install sci-ratio\n```\n\n[ca]:  https://github.com/Rufflewind/sci-ratio/actions/workflows/build.yml\n[ci]:  https://github.com/Rufflewind/sci-ratio/actions/workflows/build.yml/badge.svg\n[doc]: https://hackage.haskell.org/package/sci-ratio\n[pvp]: https://gist.github.com/Rufflewind/03f4e03f7cfa52b8f07d\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frufflewind%2Fsci-ratio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frufflewind%2Fsci-ratio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frufflewind%2Fsci-ratio/lists"}