{"id":21928084,"url":"https://github.com/depp/extended","last_synced_at":"2025-03-22T12:18:45.211Z","repository":{"id":57704062,"uuid":"496969723","full_name":"depp/extended","owner":"depp","description":"Extended 80-bit floating-point numbers for Go","archived":false,"fork":false,"pushed_at":"2022-05-27T14:09:42.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-27T11:46:07.100Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/depp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-27T11:23:19.000Z","updated_at":"2022-05-27T11:23:42.000Z","dependencies_parsed_at":"2022-09-26T21:12:01.618Z","dependency_job_id":null,"html_url":"https://github.com/depp/extended","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/depp%2Fextended","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depp%2Fextended/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depp%2Fextended/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depp%2Fextended/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/depp","download_url":"https://codeload.github.com/depp/extended/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244952914,"owners_count":20537486,"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-28T22:20:40.972Z","updated_at":"2025-03-22T12:18:45.182Z","avatar_url":"https://github.com/depp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 80-bit Extended-Precision Floating-Point Numbers\n\nThis is a Go library that provides a type for representing 80-bit extended-precision floating-point numbers. It is licensed under the terms of the MIT license, see [LICENSE.txt](LICENSE.txt) for details.\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"encoding/binary\"\n\t\"fmt\"\n\n\t\"github.com/depp/extended\"\n)\n\nfunc main() {\n\te := extended.Extended{\n\t\tSignExponent: 0x3fff,\n\t\tFraction:     0xC000000000000000,\n\t}\n\t// Value: 1.500\n\tfmt.Printf(\"Value: %.3f\\n\", e)\n\n\t// Float64: 1.500\n\tf64 := e.Float64()\n\tfmt.Printf(\"Float64: %.3f\\n\", f64)\n\n\t// Value: 100.75\n\t// SignExponent: 0x4005\n\t// Fraction: 0xc980000000000000\n\te = extended.FromFloat64(100.75)\n\tfmt.Println(\"Value:\", e)\n\tfmt.Printf(\"SignExponent: 0x%04x\\n\", e.SignExponent)\n\tfmt.Printf(\"Fraction: 0x%016x\\n\", e.Fraction)\n\n\t// Binary (big endian): 4005c980000000000000\n\tvar buf [extended.ByteSize]byte\n\te.PutBytes(binary.BigEndian, buf[:])\n\tfmt.Printf(\"Binary (big endian): %x\\n\", buf[:])\n\n\t// Binary (little endian): 00000000000080c90540\n\te.PutBytes(binary.LittleEndian, buf[:])\n\tfmt.Printf(\"Binary (little endian): %x\\n\", buf[:])\n}\n```\n\n## Rounding, Infinity, and NaN\n\nThis library uses round-to-even when converting from 80-bit floats to 64-bit floats. This should be what you’re used to, and what you expect! In round-to-even, when an 80-bit float is exactly half-way between two possible `float64` values, the value with a zero in the least-significant bit is chosen (or the value with the larger exponent is chosen, if the values have different exponents).\n\nValues which are outside the range of possible `float64` values are rounded to infinity.\n\nInfinity and NaN are preserved. Different types of NaN values are not distinguished from each other, but the sign of NaN values is preserved during conversion.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdepp%2Fextended","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdepp%2Fextended","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdepp%2Fextended/lists"}