{"id":16607973,"url":"https://github.com/alexhuszagh/rust-lexical","last_synced_at":"2025-05-14T03:07:34.396Z","repository":{"id":40282683,"uuid":"155286170","full_name":"Alexhuszagh/rust-lexical","owner":"Alexhuszagh","description":"Fast numeric to- and from-string conversion routines.","archived":false,"fork":false,"pushed_at":"2025-02-06T21:05:21.000Z","size":130249,"stargazers_count":327,"open_issues_count":13,"forks_count":40,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-12T05:04:19.266Z","etag":null,"topics":["encoding","floating-point","no-std","parsing","precision","rust","std","string-conversion"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/Alexhuszagh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-29T21:51:34.000Z","updated_at":"2025-05-06T20:34:22.000Z","dependencies_parsed_at":"2024-11-05T18:04:21.497Z","dependency_job_id":"c13dda7f-83f7-4012-8f8f-9080c6a21192","html_url":"https://github.com/Alexhuszagh/rust-lexical","commit_stats":{"total_commits":883,"total_committers":27,"mean_commits":32.7037037037037,"dds":0.3759909399773499,"last_synced_commit":"c6c5052374ac736d98b64118ecbea358adc9c7da"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alexhuszagh%2Frust-lexical","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alexhuszagh%2Frust-lexical/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alexhuszagh%2Frust-lexical/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alexhuszagh%2Frust-lexical/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alexhuszagh","download_url":"https://codeload.github.com/Alexhuszagh/rust-lexical/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254059503,"owners_count":22007768,"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":["encoding","floating-point","no-std","parsing","precision","rust","std","string-conversion"],"created_at":"2024-10-12T01:24:40.402Z","updated_at":"2025-05-14T03:07:34.359Z","avatar_url":"https://github.com/Alexhuszagh.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lexical\n\nHigh-performance numeric conversion routines for use in a `no_std` environment. This does not depend on any standard library features, nor a system allocator. Comprehensive benchmarks can be found at [lexical-benchmarks](https://github.com/Alexhuszagh/lexical-benchmarks).\n\n**Similar Projects**\n\nIf you want a minimal, performant float parser, recent versions of the Rust standard library should be [sufficient](https://github.com/rust-lang/rust/pull/86761). For high-performance integer formatters, look at [itoa](https://docs.rs/itoa/latest/itoa/). The [metrics](#metrics) section contains a detailed comparison of various crates and their performance in comparison to lexical. Lexical is the currently fastest Rust number formatter and parser, and is tested against:\n- [itoa](https://crates.io/crates/itoa)\n- [dtoa](https://crates.io/crates/dtoa)\n- [ryu](https://crates.io/crates/ryu)\n- Rust core library\n\n**Table of Contents**\n\n- [Getting Started](#getting-started)\n- [Partial/Complete Parsers](#partialcomplete-parsers)\n- [no_std](#no_std)\n- [Features](#features)\n- [Customization](#customization)\n  - [Number Format API](#number-format-api)\n  - [Options API](#options-api)\n- [Documentation](#documentation)\n- [Validation](#validation)\n- [Metrics](#metrics)\n- [Safety](#safety)\n- [Platform Support](#platform-support)\n- [Versioning and Version Support](#versioning-and-version-support)\n- [Changelog](#changelog)\n- [License](#license)\n- [Contributing](#contributing)\n\n## Getting Started\n\nAdd lexical to your `Cargo.toml`:\n\n```toml\n[dependencies]\nlexical-core = \"^1.0\"\n```\n\nAnd get started using lexical:\n\n```rust\n// Number to string\nuse lexical_core::BUFFER_SIZE;\nlet mut buffer = [b'0'; BUFFER_SIZE];\nlexical_core::write(3.0, \u0026mut buffer);   // \"3.0\", always has a fraction suffix,\nlexical_core::write(3, \u0026mut buffer);     // \"3\"\n\n// String to number.\nlet i: i32 = lexical_core::parse(\"3\")?;      // Ok(3), auto-type deduction.\nlet f: f32 = lexical_core::parse(\"3.5\")?;    // Ok(3.5)\nlet d: f64 = lexical_core::parse(\"3.5\")?;    // Ok(3.5), error checking parse.\nlet d: f64 = lexical_core::parse(\"3a\")?;     // Err(Error(_)), failed to parse.\n```\n\nIn order to use lexical in generic code, the trait bounds `FromLexical` (for `parse`) and `ToLexical` (for `to_string`) are provided.\n\n```rust\n/// Multiply a value in a string by multiplier, and serialize to string.\nfn mul_2\u003cT\u003e(value: \u0026str, multiplier: T)\n    -\u003e Result\u003cString, lexical_core::Error\u003e\nwhere\n    T: lexical_core::ToLexical + lexical_core::FromLexical,\n{\n    let value: T = lexical_core::parse(value.as_bytes())?;\n    let mut buffer = [b'0'; lexical_core::BUFFER_SIZE];\n    let bytes = lexical_core::write(value * multiplier, \u0026mut buffer);\n    Ok(String::from_utf8(bytes).unwrap())\n}\n```\n\n## Partial/Complete Parsers\n\nLexical has both partial and complete parsers: the complete parsers ensure the entire buffer is used while parsing, without ignoring trailing characters, while the partial parsers parse as many characters as possible, returning both the parsed value and the number of parsed digits. Upon encountering an error, lexical will return an error indicating both the error type and the index at which the error occurred inside the buffer.\n\n**Complete Parsers**\n\n```rust\n// This will return Err(Error::InvalidDigit(3)), indicating\n// the first invalid character occurred at the index 3 in the input\n// string (the space character).\nlet x: i32 = lexical_core::parse(b\"123 456\")?;\n```\n\n**Partial Parsers**\n\n```rust\n// This will return Ok((123, 3)), indicating that 3 digits were successfully\n// parsed, and that the returned value is `123`.\nlet (x, count): (i32, usize) = lexical_core::parse_partial(b\"123 456\")?;\n```\n\n## no_std\n\n`lexical-core` does not depend on a standard library, nor a system allocator. To use `lexical-core` in a [`no_std`] environment, add the following to `Cargo.toml`:\n\n[`no_std`]: \u003chttps://docs.rust-embedded.org/book/intro/no-std.html\u003e\n\n```toml\n[dependencies.lexical-core]\nversion = \"1.0.0\"\ndefault-features = false\n# Can select only desired parsing/writing features.\nfeatures = [\"write-integers\", \"write-floats\", \"parse-integers\", \"parse-floats\"]\n```\n\nAnd get started using `lexical-core`:\n\n```rust\n// A constant for the maximum number of bytes a formatter will write.\nuse lexical_core::BUFFER_SIZE;\nlet mut buffer = [b'0'; BUFFER_SIZE];\n\n// Number to string. The underlying buffer must be a slice of bytes.\nlet count = lexical_core::write(3.0, \u0026mut buffer);\nassert_eq!(buffer[..count], b\"3.0\");\nlet count = lexical_core::write(3i32, \u0026mut buffer);\nassert_eq!(buffer[..count], b\"3\");\n\n// String to number. The input must be a slice of bytes.\nlet i: i32 = lexical_core::parse(b\"3\")?;      // Ok(3), auto-type deduction.\nlet f: f32 = lexical_core::parse(b\"3.5\")?;    // Ok(3.5)\nlet d: f64 = lexical_core::parse(b\"3.5\")?;    // Ok(3.5), error checking parse.\nlet d: f64 = lexical_core::parse(b\"3a\")?;     // Err(Error(_)), failed to parse.\n```\n\n## Features\n\nLexical feature-gates each numeric conversion routine, resulting in faster compile times if certain numeric conversions. These features can be enabled/disabled for both `lexical-core` (which does not require a system allocator) and `lexical`. By default, all conversions are enabled.\n\n- **parse-floats**: \u0026ensp; Enable string-to-float conversions.\n- **parse-integers**: \u0026ensp; Enable string-to-integer conversions.\n- **write-floats**: \u0026ensp; Enable float-to-string conversions.\n- **write-integers**: \u0026ensp; Enable integer-to-string conversions.\n\nLexical is highly customizable, and contains numerous other optional features:\n\n- **std**: \u0026ensp; Enable use of the Rust standard library (enabled by default).\n- **power-of-two**: \u0026ensp; Enable conversions to and from non-decimal strings.\n    \u003cblockquote\u003eWith power_of_two enabled, the radixes \u003ccode\u003e{2, 4, 8, 10, 16, and 32}\u003c/code\u003e are valid, otherwise, only \u003ccode\u003e10\u003c/code\u003e is valid. This enables common conversions to/from hexadecimal integers/floats, without requiring large pre-computed tables for other radixes.\u003c/blockquote\u003e\n- **radix**: \u0026ensp; Allow conversions to and from non-decimal strings.\n    \u003cblockquote\u003eWith radix enabled, any radix from \u003ccode\u003e2\u003c/code\u003e to \u003ccode\u003e36\u003c/code\u003e (inclusive) is valid, otherwise, only \u003ccode\u003e10\u003c/code\u003e is valid.\u003c/blockquote\u003e\n- **format**: \u0026ensp; Customize acceptable number formats for number parsing and writing.\n    \u003cblockquote\u003eWith format enabled, the number format is dictated through bitflags and masks packed into a \u003ccode\u003eu128\u003c/code\u003e. These dictate the valid syntax of parsed and written numbers, including enabling digit separators, requiring integer or fraction digits, and toggling case-sensitive exponent characters.\u003c/blockquote\u003e\n- **compact**: \u0026ensp; Optimize for binary size at the expense of performance.\n    \u003cblockquote\u003eThis minimizes the use of pre-computed tables, producing significantly smaller binaries.\u003c/blockquote\u003e\n- **f16**: \u0026ensp; Add support for numeric conversions to-and-from 16-bit floats.\n    \u003cblockquote\u003eAdds \u003ccode\u003ef16\u003c/code\u003e, a half-precision IEEE-754 floating-point type, and \u003ccode\u003ebf16\u003c/code\u003e, the Brain Float 16 type, and numeric conversions to-and-from these floats. Note that since these are storage formats, and therefore do not have native arithmetic operations, all conversions are done using an intermediate \u003ccode\u003ef32\u003c/code\u003e.\u003c/blockquote\u003e\n\nTo ensure memory safety, we extensively fuzz the all numeric conversion routines. See the [Safety](#safety) section below for more information.\n\nLexical also places a heavy focus on code bloat: with algorithms both optimized for performance and size. By default, this focuses on performance, however, using the `compact` feature, you can also opt-in to reduced code size at the cost of performance. The compact algorithms minimize the use of pre-computed tables and other optimizations at a major cost to performance.\n\n## Customization\n\nLexical is extensively customizable to support parsing numbers from a wide variety of programming languages, such as `1_2_3`. However, lexical takes the concept of \"you don't pay for what you don't use\" seriously: enabling the `format` feature does not affect the performance of parsing regular numbers: only those with digit separators.\n\n\u003e ⚠ **WARNING:** When changing the number of significant digits written, disabling the use of exponent notation, or changing exponent notation thresholds, `BUFFER_SIZE` may be insufficient to hold the resulting output. `WriteOptions::buffer_size_const` will provide a correct upper bound on the number of bytes written. If a buffer of insufficient length is provided, `lexical-core` will panic.\n\nEvery language has competing specifications for valid numerical input, meaning a number parser for Rust will incorrectly accept or reject input for different programming or data languages. For example:\n\n```rust\n// Valid in Rust strings.\n// Not valid in JSON.\nlet f: f64 = lexical_core::parse(b\"3.e7\")?;  // 3e7\n\n// Let's only accept JSON floats.\nconst JSON: u128 = lexical_core::format::JSON;\nconst OPTIONS: ParseFloatOptions = ParseFloatOptions::new();\nlet f: f64 = lexical_core::parse_with_options::\u003c_, JSON\u003e(b\"3.0e7\", \u0026OPTIONS)?; // 3e7\nlet f: f64 = lexical_core::parse_with_options::\u003c_, JSON\u003e(b\"3.e7\", \u0026OPTIONS)?;  // Errors!\n```\n\nDue the high variability in the syntax of numbers in different programming and data languages, we provide 2 different APIs to simplify converting numbers with different syntax requirements.\n\n- Number Format API (feature-gated via `format` or `power-of-two`).\n    \u003cblockquote\u003eThis is a packed struct contained flags to specify compile-time syntax rules for number parsing or writing. This includes features such as the radix of the numeric string, digit separators, case-sensitive exponent characters, optional base prefixes/suffixes, and more.\u003c/blockquote\u003e\n- Options API.\n    \u003cblockquote\u003eThis contains run-time rules for parsing and writing numbers. This includes exponent break points, rounding modes, the exponent and decimal point characters, and the string representation of NaN and Infinity.\u003c/blockquote\u003e\n\nA limited subset of functionality is documented in examples below, however, the complete specification can be found in the API reference documentation ([parse-float](https://docs.rs/lexical-parse-float/latest/lexical_parse_float/struct.Options.html), [parse-integer](https://docs.rs/lexical-parse-integer/latest/lexical_parse_integer/struct.Options.html), and [write-float](https://docs.rs/lexical-write-float/latest/lexical_write_float/struct.Options.html)).\n\n### Number Format API\n\nThe number format class provides numerous flags to specify number syntax when parsing or writing. When the `power-of-two` feature is enabled, additional flags are added:\n\n- The radix for the significant digits (default `10`).\n- The radix for the exponent base (default `10`).\n- The radix for the exponent digits (default `10`).\n\nWhen the `format` feature is enabled, numerous other syntax and digit separator flags are enabled, including:\n\n- A digit separator character, to group digits for increased legibility.\n- Whether leading, trailing, internal, and consecutive digit separators are allowed.\n- Toggling required float components, such as digits before the decimal point.\n- Toggling whether special floats are allowed or are case-sensitive.\n\nMany pre-defined constants therefore exist to simplify common use-cases,\nincluding:\n- [`JSON`], [`XML`], [`TOML`], [`YAML`], [`SQLite`], and many more.\n- [`Rust`], [`Python`], [`C#`], [`FORTRAN`], [`COBOL`] literals and strings, and many more.\n\n[`JSON`]: https://docs.rs/lexical-core/latest/lexical_core/format/constant.JSON.html\n[`XML`]: https://docs.rs/lexical-core/latest/lexical_core/format/constant.XML.html\n[`TOML`]: https://docs.rs/lexical-core/latest/lexical_core/format/constant.TOML.html\n[`YAML`]: https://docs.rs/lexical-core/latest/lexical_core/format/constant.YAML.html\n[`SQLite`]: https://docs.rs/lexical-core/latest/lexical_core/format/constant.SQLITE.html\n[`Rust`]: https://docs.rs/lexical-core/latest/lexical_core/format/constant.RUST_LITERAL.html\n[`Python`]: https://docs.rs/lexical-core/latest/lexical_core/format/constant.PYTHON_LITERAL.html\n[`C#`]: https://docs.rs/lexical-core/latest/lexical_core/format/constant.CSHARP_LITERAL.html\n[`FORTRAN`]: https://docs.rs/lexical-core/latest/lexical_core/format/constant.FORTRAN_LITERAL.html\n[`COBOL`]: https://docs.rs/lexical-core/latest/lexical_core/format/constant.COBOL_LITERAL.html\n\nAn example of building a custom number format is as follows:\n\n```rust\n// this will panic if the format is invalid\nconst FORMAT: u128 = lexical_core::NumberFormatBuilder::new()\n    // Disable exponent notation.\n    .no_exponent_notation(true)\n    // Disable all special numbers, such as Nan and Inf.\n    .no_special(true)\n    .build_strict();\n```\n\n### Options API\n\nThe options API allows customizing number parsing and writing at run-time, such as specifying the maximum number of significant digits, exponent characters, and more.\n\nAn example of building a custom options struct is as follows:\n\n```rust\nuse std::num;\n\nconst OPTIONS: lexical_core::WriteFloatOptions = lexical_core::WriteFloatOptions::builder()\n    // Only write up to 5 significant digits, IE, `1.23456` becomes `1.2345`.\n    .max_significant_digits(num::NonZeroUsize::new(5))\n    // Never write less than 5 significant digits, `1.1` becomes `1.1000`.\n    .min_significant_digits(num::NonZeroUsize::new(5))\n    // Trim the trailing `.0` from integral float strings.\n    .trim_floats(true)\n    // Use a European-style decimal point.\n    .decimal_point(b',')\n    // Panic if we try to write NaN as a string.\n    .nan_string(None)\n    // Write infinity as \"Infinity\".\n    .inf_string(Some(b\"Infinity\"))\n    .build_strict();\n```\n\n## Documentation\n\nLexical's API reference can be found on [docs.rs](https://docs.rs/lexical), as can [lexical-core's](lexical-core). Detailed descriptions of the algorithms used can be found here:\n\n- [Parsing Integers](https://github.com/Alexhuszagh/rust-lexical/blob/main/lexical-parse-integer/docs/Algorithm.md)\n- [Parsing Floats](https://github.com/Alexhuszagh/rust-lexical/blob/main/lexical-parse-float/docs/Algorithm.md)\n- [Writing Integers](https://github.com/Alexhuszagh/rust-lexical/blob/main/lexical-write-integer/docs/Algorithm.md)\n- [Writing Floats](https://github.com/Alexhuszagh/rust-lexical/blob/main/lexical-write-float/docs/Algorithm.md)\n\nIn addition, descriptions of how lexical handles [digit separators](https://github.com/Alexhuszagh/rust-lexical/blob/main/docs/DigitSeparators.md) and implements [big-integer arithmetic](https://github.com/Alexhuszagh/rust-lexical/blob/main/lexical-parse-float/docs/BigInteger.md) are also documented.\n\n## Validation\n\n**Float-Parsing**\n\nFloat parsing is difficult to do correctly, and major bugs have been found in implementations from [libstdc++'s strtod](https://www.exploringbinary.com/glibc-strtod-incorrectly-converts-2-to-the-negative-1075/) to [Python](https://bugs.python.org/issue7632). In order to validate the accuracy of the lexical, we employ the following external tests:\n\n1. Hrvoje Abraham's [strtod](https://github.com/ahrvoje/numerics/tree/master/strtod) test cases.\n2. Rust's [test-float-parse](https://github.com/rust-lang/rust/tree/64185f205dcbd8db255ad6674e43c63423f2369a/src/etc/test-float-parse) unittests.\n3. Testbase's [stress tests](https://www.icir.org/vern/papers/testbase-report.pdf) for converting from decimal to binary.\n4. Nigel Tao's [tests](https://github.com/nigeltao/parse-number-fxx-test-data) extracted from test suites for Freetype, Google's double-conversion library, IBM's IEEE-754R compliance test, as well as numerous other curated examples.\n5. [Various](https://www.exploringbinary.com/glibc-strtod-incorrectly-converts-2-to-the-negative-1075/) [difficult](https://www.exploringbinary.com/how-glibc-strtod-works/) [cases](https://www.exploringbinary.com/how-strtod-works-and-sometimes-doesnt/) reported on blogs.\n\nLexical is extensively used in production, the same float parsing algorithm has been adopted by Golang's and Rust's standard libraries, and is unlikely to have correctness issues.\n\n## Metrics\n\nVarious benchmarks, binary sizes, and compile times are shown here. All the benchmarks can be found on [lexical-benchmarks](https://github.com/Alexhuszagh/lexical-benchmarks?tab=readme-ov-file#latest-results). All benchmarks used a black box to avoid optimizing out the result and leading to misleading metrics.\n\n**Build Timings**\n\nThe compile-times when building with all numeric conversions enabled. For a more fine-tuned breakdown, see [build timings](https://github.com/Alexhuszagh/rust-lexical/blob/main/docs/BuildTimings.md).\n\n![Build Timings](https://raw.githubusercontent.com/Alexhuszagh/rust-lexical/main/assets/timings_all_posix.svg)\n\n**Binary Size**\n\nThe binary sizes of stripped binaries compiled at optimization level \"2\". For a more fine-tuned breakdown, see [binary sizes](https://github.com/Alexhuszagh/rust-lexical/blob/main/docs/BinarySize.md).\n\n![Parse Stripped - Optimization Level \"2\"](https://raw.githubusercontent.com/Alexhuszagh/rust-lexical/main/assets/size_parse_stripped_opt2_posix.svg)\n![Write Stripped - Optimization Level \"2\"](https://raw.githubusercontent.com/Alexhuszagh/rust-lexical/main/assets/size_write_stripped_opt2_posix.svg)\n\n### Benchmarks — Parse Integer\n\n**Random**\n\nA benchmark on randomly-generated integers uniformly distributed over the entire range.\n\n![Uniform Random Data](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/latest/plot/json_random%20-%20parse%20int%20-%20core,lexical.png)\n\n**Simple**\n\nA benchmark on randomly-generated integers from 1-1000.\n\n![Simple Random Data](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/latest/plot/json_simple%20-%20parse%20int%20-%20core,lexical.png)\n\n### Benchmarks — Parse Float\n\n**Real-World Datasets**\n\nA benchmark on parsing floats from various real-world data sets, including Canada, Mesh, and astronomical data (earth).\n\n![Canada](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/latest/plot/canada%20-%20parse%20float%20-%20core,lexical.png)\n\n![Earth](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/latest/plot/earth%20-%20parse%20float%20-%20core,lexical.png)\n\n![Mesh](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/latest/plot/mesh%20-%20parse%20float%20-%20core,lexical.png)\n\n**Random**\n\nA benchmark on randomly-generated integers uniformly distributed over the entire range.\n\n![Random Big Integer](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/latest/plot/random_big_ints%20-%20parse%20float%20-%20core,lexical.png)\n\n**Simple**\n\nA benchmark on randomly-generated integers from 1-1000.\n\n![Random Simple](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/latest/plot/random_simple_int64%20-%20parse%20float%20-%20core,lexical.png)\n\n### Benchmarks — Write Integer\n\n**Random**\n\nA benchmark on randomly-generated integers uniformly distributed over the entire range.\n\n![Random Uniform](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/latest/plot/json_chain_random%20-%20write%20int%20-%20fmt,itoa,lexical.png)\n\n**Simple**\n\n![Random Simple](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/latest/plot/json_simple%20-%20write%20int%20-%20fmt,itoa,lexical.png)\n\n**Large**\n\n![Random Large](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/latest/plot/random_large%20-%20write%20int%20-%20fmt,itoa,lexical.png)\n\n### Benchmarks — Write Float\n\n**Big Integer**\n\nA benchmarks for values with a large integers.\n\n![Big Integers](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/latest/plot/random_big_ints%20-%20write%20float%20-%20dtoa,fmt,lexical,ryu.png)\n\n**Simple 64-Bit Inteers**\n\n![Simple Int64](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/latest/plot/random_simple_int64%20-%20write%20float%20-%20dtoa,fmt,lexical,ryu.png)\n\n**Random**\n\n![Random](https://github.com/Alexhuszagh/lexical-benchmarks/raw/main/results/latest/plot/json%20-%20write%20float%20-%20dtoa,fmt,lexical,ryu.png)\n\n## Safety\n\nDue to the use of memory unsafe code in the library, we extensively fuzz our float writers and parsers. The fuzz harnesses may be found under [fuzz](https://github.com/Alexhuszagh/rust-lexical/tree/main/fuzz), and are run continuously. So far, we've parsed and written over 72 billion floats.\n\n## Platform Support\n\nlexical-core is tested on a wide variety of platforms, including big and small-endian systems, to ensure portable code. Supported architectures include:\n- x86_64 Linux, Windows, macOS, Android, iOS, FreeBSD, and NetBSD.\n- x86 Linux, macOS, Android, iOS, and FreeBSD.\n- aarch64 (ARM8v8-A) Linux, Android, and iOS.\n- armv7 (ARMv7-A) Linux, Android, and iOS.\n- arm (ARMv6) Linux, and Android.\n- powerpc (PowerPC) Linux.\n- powerpc64 (PPC64) Linux.\n- powerpc64le (PPC64LE) Linux.\n- s390x (IBM Z) Linux.\n\nlexical-core should also work on a wide variety of other architectures and ISAs. If you have any issue compiling lexical-core on any architecture, please file a bug report.\n\n## Versioning and Version Support\n\n**Version Support**\n\nThe currently supported versions are:\n- v1.0.x\n\nDue to security considerations, all other versions are not supported and security advisories exist for them.\n\n**Rustc Compatibility**\n\n- v1.0.x supports 1.63+, including stable, beta, and nightly.\n\nPlease report any errors compiling a supported `lexical` version on a compatible Rustc version.\n\n**Versioning**\n\n`lexical` uses [semantic versioning](https://semver.org/). Removing support for Rustc versions newer than the latest stable Debian or Ubuntu version is considered an incompatible API change, requiring a major version change.\n\n## Changelog\n\nAll changes are documented in [CHANGELOG](https://github.com/Alexhuszagh/rust-lexical/blob/main/CHANGELOG).\n\n## License\n\nLexical is dual licensed under the Apache 2.0 license as well as the MIT license. See the [LICENSE.md](LICENSE.md) file for full license details.\n\n## Contributing\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in `lexical` by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. Contributing to the repository means abiding by the [code of conduct](https://github.com/Alexhuszagh/rust-lexical/blob/main/CODE_OF_CONDUCT.md).\n\nFor the process on how to contribute to `lexical`, see the [development](https://github.com/Alexhuszagh/rust-lexical/blob/main/docs/Development.md) quick-start guide.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexhuszagh%2Frust-lexical","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexhuszagh%2Frust-lexical","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexhuszagh%2Frust-lexical/lists"}