{"id":25195856,"url":"https://github.com/s-expressionists/quaviver","last_synced_at":"2025-10-17T06:21:41.031Z","repository":{"id":241831134,"uuid":"807737239","full_name":"s-expressionists/Quaviver","owner":"s-expressionists","description":"A portable and extensible floating point base conversion and string library","archived":false,"fork":false,"pushed_at":"2025-01-14T12:34:57.000Z","size":364,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-10T01:38:38.622Z","etag":null,"topics":["common-lisp","floating-point"],"latest_commit_sha":null,"homepage":"","language":"Common Lisp","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/s-expressionists.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-29T17:13:03.000Z","updated_at":"2025-01-14T12:34:58.000Z","dependencies_parsed_at":"2024-08-21T16:14:14.621Z","dependency_job_id":null,"html_url":"https://github.com/s-expressionists/Quaviver","commit_stats":null,"previous_names":["s-expressionists/quaviver"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-expressionists%2FQuaviver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-expressionists%2FQuaviver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-expressionists%2FQuaviver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s-expressionists%2FQuaviver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s-expressionists","download_url":"https://codeload.github.com/s-expressionists/Quaviver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208019,"owners_count":20901568,"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":["common-lisp","floating-point"],"created_at":"2025-02-10T01:38:50.779Z","updated_at":"2025-10-17T06:21:40.940Z","avatar_url":"https://github.com/s-expressionists.png","language":"Common Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quaviver\n\nA portable and extensible floating point base conversion and string library.\n\n## Introduction\n\nQuaviver is a collection of Common Lisp systems that implement various\nalgorithms for changing the base (or radix) of floating point numbers\nand for parsing and writing numbers. It includes many utility\nfunctions for reading and writing numerical digits, performing\narithmetic on floating point significands and binary encoding of\nfloating point numbers into formats like [binary32][]. Quaviver also\nincludes a high-level interface to reading, writing and parsing\nnumbers in various formats.\n\n## QUAVIVER/STREAM system and package\n\nThe QUAVIVER/STREAM package includes three different functions for\nparsing, reading and writing numbers. Each one of these functions take\nseveral keyword arguments which control the serialization method. All\nthree functions include a keyword argument :STYLE which selects the\noverall number format as per the following table.\n\n| Value            | Description                                           |\n|------------------|-------------------------------------------------------|\n| :BLUB            | Generic integers and floating point                   |\n| :C89             | C89 Standard integers and floating point              |\n| :C99             | C99 Standard integers and floating point              |\n| :C11             | C11 Standard integers and floating point              |\n| :C17             | C17 Standard integers and floating point              |\n| :C23             | C23 Standard integers and floating point              |\n| :C++98           | C++98 Standard integers and floating point            |\n| :C++03           | C++03 Standard integers and floating point            |\n| :C++11           | C++11 Standard integers and floating point            |\n| :C++14           | C++14 Standard integers and floating point            |\n| :C++17           | C++17 Standard integers and floating point            |\n| :C++20           | C++20 Standard integers and floating point            |\n| :C++23           | C++23 Standard integers and floating point            |\n| :C++26           | C++26 Standard integers and floating point            |\n| :COMMON-LISP     | Common Lisp ratios, integers and floating point       |\n| :COMMON-LISP/CCL | Common Lisp including CCL infinity and NaN extensions |\n| :FORTRAN         | Fortran integers and floating point                   |\n| :JSON            | JSON integers and floating point                      |\n| :PYTHON          | Python integers and floating point                    |\n\n### parse-number\n\n```common-lisp\n(parse-number string\n              \u0026key (start 0) (end (length string)) (base 10) junk-allowed\n                   (integer t) (ratio t) (float t)\n                   float-type (style :common-lisp)\n                   (whitespace '(#\\space #\\tab #\\page #\\newline #\\return)))\n;; =\u003e number, position\n```\n\nParse a number from STRING. START and END specify a substring of STRING. \n\nThe initial number base is determined by BASE. Some values of STYLE\nallow number prefixes that can change the default base. For example,\nthe C styles will parse hexadecimal numbers via the prefix `0x` if\nthat is permitted by the specific standard.\n\nJUNK-ALLOWED determines if trailing non-whitespace is permitted.\n\nINTEGER, RATIO, and FLOAT are booleans that control whether to read\nintegers, fractions or floating point numbers. By default all of these\nare non-NIL so if the specific style supports it than any one of these\nnumbers will be parsed.\n\nThe default floating type is determined by FLOAT-TYPE. Some styles,\nfor example Common Lisp, have the ability to specify the floating\npoint type using the exponent marker or a type suffix.\n\nWHITESPACE is a character bag or a predicate function that is used to\nskip over whitespace before the number. It is also used to determine\nif there is trailing junk after the number.\n\nNUMBER is the result of parsing.\n\nPOSITION the index to the end of the number in STRING.\n\n#### Examples\n\n```\nCL-USER\u003e (asdf:load-system \"quaviver/stream\")\n          \nT\nCL-USER\u003e (quaviver/stream:parse-number \"  3.1415926535897932384626433832795028841971d0\")\n3.141592653589793d0\n46\nCL-USER\u003e (quaviver/stream:parse-number \"  314\")\n314\n5\nCL-USER\u003e (quaviver/stream:parse-number \"  0xfa\" :style :c99)\n250\n6\nCL-USER\u003e (quaviver/stream:parse-number \"  0xfa.e10\" :style :c99)\n; Evaluation aborted on #\u003cQUAVIVER.CONDITION:INVALID-CHARACTER-ERROR {1002EF2FA3}\u003e.\nCL-USER\u003e (quaviver/stream:parse-number \"  0xfa.e10\" :style :c++20)\n700.0d0\n10\n```\n\n### read-number\n\n```common-lisp\n(read-number stream\n             \u0026key (base 10) junk-allowed\n                  (integer t) (ratio t) (float t)\n                  float-type (style :common-lisp)\n                  (whitespace '(#\\space #\\tab #\\page #\\newline #\\return)))\n;; =\u003e number\n```\n\nREAD-NUMBER is identical to PARSE-NUMBER, except that it reads the\nnumber from a stream versus a string.\n\n### write-number\n\n```common-lisp\n(write-number value stream\n              \u0026key (base 10) (style :common-lisp))\n```\n\nWRITE-NUMBER writes VALUE to STREAM. BASE and STYLE have the same\nmeanings as in PARSE-NUMBER.\n\n[binary32]: https://en.wikipedia.org/wiki/Single-precision_floating-point_format\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs-expressionists%2Fquaviver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs-expressionists%2Fquaviver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs-expressionists%2Fquaviver/lists"}