{"id":16662045,"url":"https://github.com/leventerkok/floatinghex","last_synced_at":"2025-04-09T18:52:30.303Z","repository":{"id":66386768,"uuid":"78923967","full_name":"LeventErkok/FloatingHex","owner":"LeventErkok","description":"Hexadecimal Floats for Haskell","archived":false,"fork":false,"pushed_at":"2020-09-05T22:23:48.000Z","size":16,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-23T20:51:14.166Z","etag":null,"topics":["floating-point","haskell","hexadecimal-floats","ieee754"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","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/LeventErkok.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","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,"publiccode":null,"codemeta":null}},"created_at":"2017-01-14T07:18:47.000Z","updated_at":"2025-01-30T23:40:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"76bba77e-7021-4923-81e8-9a849c237aae","html_url":"https://github.com/LeventErkok/FloatingHex","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/LeventErkok%2FFloatingHex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeventErkok%2FFloatingHex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeventErkok%2FFloatingHex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeventErkok%2FFloatingHex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeventErkok","download_url":"https://codeload.github.com/LeventErkok/FloatingHex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248093022,"owners_count":21046599,"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":["floating-point","haskell","hexadecimal-floats","ieee754"],"created_at":"2024-10-12T10:36:49.387Z","updated_at":"2025-04-09T18:52:30.293Z","avatar_url":"https://github.com/LeventErkok.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## FloatingHex: Read/Write Hexadecimal floats\n\n[![Hackage version](http://img.shields.io/hackage/v/FloatingHex.svg?label=Hackage)](http://hackage.haskell.org/package/FloatingHex)\n[![Build Status](http://img.shields.io/travis/LeventErkok/FloatingHex.svg?label=Build)](http://travis-ci.org/LeventErkok/FloatingHex)\n\n### Hexadecimal Floats\n\nFor syntax reference, see: \u003chttp://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf\u003e, pages 57-58.\nWe slightly diverge from the standard and do not allow for the \"floating-suffix,\"\nas the type inference of Haskell makes this unnecessary. Some examples are:\n\n```\n  [hf|0x1p+1|]\n  [hf|0x1p+8|]\n  [hf|0x1.b7p-1|]\n  [hf|0x1.fffffffffffffp+1023|]\n  [hf|0X1.921FB4D12D84AP-1|]\n```\n\nThis format allows for concise and precise string representation for floating point numbers. Note that you need the `QuasiQuotes` extension of GHC to be able to write these literals.\n\n## Example\n\n```haskell\n{-# LANGUAGE QuasiQuotes #-}\nimport Data.Numbers.FloatingHex\n\n-- expressions\nf :: Double\nf = [hf|0x1.f44abd5aa7ca4p+25|]\n\n-- patterns\ng :: Float -\u003e String\ng [hf|0x1p1|]  = \"two!\"\ng [hf|0x1p-1|] = \"half!\"\ng d            = \"something else: \" ++ show d\n\n-- showing hexadecimal floats\ntest = showHFloat [hf|0x1.f44abd5aa7ca4p+25|] \"\"\n```\n\n(Note that while the quasiquoter allows for floating-point patterns, it is usually not a good idea to use floating-point literals in pattern matching.)\n\n### Thanks\nThe following people reported bugs, provided comments/feedback, or contributed to the development of\nFloatingHex in various ways: Herbert Valerio Riedel.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleventerkok%2Ffloatinghex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleventerkok%2Ffloatinghex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleventerkok%2Ffloatinghex/lists"}