{"id":16098972,"url":"https://github.com/hellerve/silly","last_synced_at":"2025-04-05T22:43:48.274Z","repository":{"id":79626367,"uuid":"274480360","full_name":"hellerve/silly","owner":"hellerve","description":"A silly implementation of fixed point arithmetic (mirror because I linked here on my blog)","archived":false,"fork":false,"pushed_at":"2020-06-23T18:31:40.000Z","size":17,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T05:12:03.413Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","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/hellerve.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-23T18:31:06.000Z","updated_at":"2023-09-08T18:09:09.000Z","dependencies_parsed_at":"2023-03-06T17:15:35.377Z","dependency_job_id":null,"html_url":"https://github.com/hellerve/silly","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellerve%2Fsilly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellerve%2Fsilly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellerve%2Fsilly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellerve%2Fsilly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hellerve","download_url":"https://codeload.github.com/hellerve/silly/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411193,"owners_count":20934650,"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-10-09T18:25:15.810Z","updated_at":"2025-04-05T22:43:48.246Z","avatar_url":"https://github.com/hellerve.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# silly\n\nA toy library implementing fixed-point arithmetic.\nPlease don’t use it, the name is descriptive.\n\nIt’s also pretty inefficient.\n\n## Installation\n\nDon’t. The makefile only includes a test target, because I want to test my code.\n\n## Usage\n\n```c\nsilly silly_zeros(); // creates a fixed point value of zero\nsilly make_silly(short, int, int); // make a silly number from the triple (negative?, before decimal, after)\nsilly silly_from_float(float); // creates a silly number from a float\nsilly silly_from_double(double); // creates a silly number from a double\n\ndouble silly_to_double(silly); // convert a silly number into a double\nuint64_t silly_to_uraw(silly); // convert the silly struct to a raw value (without sign)\nint64_t silly_to_raw(silly); // convert the silly struct to a raw value (with sign)\n\nsilly silly_add(silly, silly); // addition\nsilly silly_sub(silly, silly); // subtraction\nsilly silly_mul(silly, silly); // multiplication\nsilly silly_idiv(silly, silly); // division (integer precision)\nsilly silly_div(silly, silly); // division\n\nchar* silly_to_string(silly); // converts a fixed point value to a string (memory is now yours)\n```\n\nThat's it!\n\n\u003chr/\u003e\n\nHave fun!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellerve%2Fsilly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhellerve%2Fsilly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellerve%2Fsilly/lists"}