commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
8ab22539e2ddf1965842406964aa7b2b7ffd3406 | Alex Huszagh | 2024-12-06T18:52:14 | Increment versions for release. | diff --git a/lexical-core/Cargo.toml b/lexical-core/Cargo.toml
index e47732b..0c972ab 100644
--- a/lexical-core/Cargo.toml
+++ b/lexical-core/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical-core"
readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-lexical"
-version = "1.0.2"
... | 7 | 19 | 19 |
56ccd403d65522213e32eb4af9c232f5e4f046fb | Alex Huszagh | 2024-12-06T00:04:46 | Add in optimizations for 2^N radix integer writing.
This adds in performance enhancements by using correct optimizations for calculating digit counts. | diff --git a/lexical-write-integer/src/digit_count.rs b/lexical-write-integer/src/digit_count.rs
index ec49b5d..d8812ba 100644
--- a/lexical-write-integer/src/digit_count.rs
+++ b/lexical-write-integer/src/digit_count.rs
@@ -122,34 +122,46 @@ fn digit_log2<T: UnsignedInteger>(x: T) -> usize {
/// Highly-optimized di... | 2 | 61 | 16 |
e11c0ecff3fd0da029310670d3ae0aa971595795 | Alex Huszagh | 2024-12-05T18:06:39 | Ensure the digit count tests work on 1.65.0 | diff --git a/lexical-write-integer/Cargo.toml b/lexical-write-integer/Cargo.toml
index eb9c9f1..42b97f6 100644
--- a/lexical-write-integer/Cargo.toml
+++ b/lexical-write-integer/Cargo.toml
@@ -34,6 +34,7 @@ features = ["write-integers"]
# Fix: https://github.com/BurntSushi/quickcheck/pull/296
quickcheck = { git ... | 2 | 5 | 0 |
cfdede0a779b54188105e26e3b4049ef802939e2 | Alex Huszagh | 2024-12-05T17:21:01 | Add optimizations for digit counting.
This adds optimizations for base 2 and base 4 radices, which can use fast log2 implementations for digit counting. | diff --git a/lexical-write-integer/src/digit_count.rs b/lexical-write-integer/src/digit_count.rs
index 2a3f36f..ec49b5d 100644
--- a/lexical-write-integer/src/digit_count.rs
+++ b/lexical-write-integer/src/digit_count.rs
@@ -8,6 +8,7 @@
#![doc(hidden)]
use lexical_util::{
+ assert::debug_assert_radix,
div12... | 2 | 282 | 13 |
e622374738925712622fac65f88e4ee9e0bfd821 | Alex Huszagh | 2024-12-05T03:10:30 | Allow serialization of all type sizes.
This removes the intermediate cast to wide types for 8 and 16-bit types, since we use compile-time checks for the size to see if the integer is large enough. | diff --git a/lexical-write-float/src/algorithm.rs b/lexical-write-float/src/algorithm.rs
index dd5bc25..6372040 100644
--- a/lexical-write-float/src/algorithm.rs
+++ b/lexical-write-float/src/algorithm.rs
@@ -761,7 +761,7 @@ pub fn compute_right_closed_directed<F: RawFloat>(float: F, shorter: bool) -> Ex
#[allow(clipp... | 10 | 96 | 158 |
fa75ff4c1d08fe45d5413aeb0dca63f2708ad6d7 | Alex Huszagh | 2024-12-05T00:55:14 | Conditionally use multi-digit optimizations.
This avoids the potential of overflowing with multi-digit optimizations for `radix^2` and `radix^4`, however, implementing the writers in terms of this has yet to be done. | diff --git a/lexical-write-integer/src/algorithm.rs b/lexical-write-integer/src/algorithm.rs
index 0566ce7..48f2138 100644
--- a/lexical-write-integer/src/algorithm.rs
+++ b/lexical-write-integer/src/algorithm.rs
@@ -91,41 +91,50 @@ unsafe fn write_digits<T: UnsignedInteger>(
debug_assert_radix(radix);
debug_... | 1 | 30 | 21 |
f5ed3bc3706524b691d89899419d2c858eb5d5de | Alex Huszagh | 2024-12-05T00:38:34 | Add multi-digit digit calculation optimizations. | diff --git a/lexical-write-integer/src/digit_count.rs b/lexical-write-integer/src/digit_count.rs
index 14c7e68..2a3f36f 100644
--- a/lexical-write-integer/src/digit_count.rs
+++ b/lexical-write-integer/src/digit_count.rs
@@ -34,11 +34,38 @@ pub fn fast_log2<T: UnsignedInteger>(x: T) -> usize {
// Uses a naive approach... | 1 | 29 | 2 |
44e8860dc58d545100363edd1445370e84edf9ce | Alex Huszagh | 2024-12-05T00:23:24 | Add in optimizations for 128-bit integers. | diff --git a/lexical-write-integer/src/digit_count.rs b/lexical-write-integer/src/digit_count.rs
index 787d7a4..14c7e68 100644
--- a/lexical-write-integer/src/digit_count.rs
+++ b/lexical-write-integer/src/digit_count.rs
@@ -7,7 +7,11 @@
#![cfg(not(feature = "compact"))]
#![doc(hidden)]
-use lexical_util::num::Unsi... | 1 | 61 | 15 |
a498a4bc5ca72250a4f36ccac7f9de85d9c6882e | Alex Huszagh | 2024-12-04T21:56:37 | Fix issues with writing radix numbers.
This uses an unoptimized approach for non-decimal numbers, which calculates the number of digits rather than write the digits and shift them into place. Due to the high overhead of memcpy, this is likely to be more performant, however, this has noticeable overhead issues with pow... | diff --git a/lexical-write-float/src/algorithm.rs b/lexical-write-float/src/algorithm.rs
index 4c6b4ec..dd5bc25 100644
--- a/lexical-write-float/src/algorithm.rs
+++ b/lexical-write-float/src/algorithm.rs
@@ -32,7 +32,7 @@ use lexical_util::bf16::bf16;
use lexical_util::f16::f16;
use lexical_util::format::{NumberForm... | 10 | 398 | 218 |
e6d45c25b026049892977b71b87d8dc5324cf048 | Alex Huszagh | 2024-10-31T23:21:19 | Make clippy happy. | diff --git a/lexical-parse-integer/src/algorithm.rs b/lexical-parse-integer/src/algorithm.rs
index a5b081d..5f0f841 100644
--- a/lexical-parse-integer/src/algorithm.rs
+++ b/lexical-parse-integer/src/algorithm.rs
@@ -136,7 +136,7 @@ macro_rules! fmt_invalid_digit {
let is_suffix = if uncased_base_suffix {
... | 2 | 4 | 4 |
223280dcdcf7d077337e0c2f1ac09892baf811f4 | Alex Huszagh | 2024-10-15T19:03:03 | Add 1.63.0 MSRV to our Cargo.toml. | diff --git a/lexical-core/Cargo.toml b/lexical-core/Cargo.toml
index c69043a..e47732b 100644
--- a/lexical-core/Cargo.toml
+++ b/lexical-core/Cargo.toml
@@ -10,6 +10,7 @@ name = "lexical-core"
readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-lexical"
version = "1.0.2"
+rust-version = "1.63.0"
... | 7 | 7 | 0 |
cf73df2ed770da15e2e0ead4839c4c714f4ded72 | Alex Huszagh | 2024-10-04T00:51:33 | Update fuzzing dependencies and logic.
Get rid of LTO, which has a bug with `__sancov_gen_` being an undefined symbol. Also, this updates the macro use to directly import the symbols to reflect more modern Rust design. | diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml
index 9c121e4..6d8b059 100644
--- a/fuzz/Cargo.toml
+++ b/fuzz/Cargo.toml
@@ -34,7 +34,7 @@ default-features = false
features = []
[dependencies]
-libfuzzer-sys = "0.2.0"
+libfuzzer-sys = "0.4.7"
[features]
std = [
@@ -74,7 +74,6 @@ compact = [
opt-level = 3
debu... | 36 | 41 | 66 |
6ab9853b7157b339a8cc14f7e511d9194f12f25a | Alex Huszagh | 2024-09-25T00:24:54 | Increment lexical dependency. | diff --git a/lexical/Cargo.toml b/lexical/Cargo.toml
index 04e6eb9..7e9c4e8 100644
--- a/lexical/Cargo.toml
+++ b/lexical/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical"
readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-lexical"
-version = "7.0.1"
+version = "7.0.2"
exclu... | 1 | 1 | 1 |
8282e2475aa249224f4492ed37ecf3095ebe2705 | Alex Huszagh | 2024-09-25T00:23:45 | Fix write float version. | diff --git a/lexical-write-float/Cargo.toml b/lexical-write-float/Cargo.toml
index a9f4b57..74fc125 100644
--- a/lexical-write-float/Cargo.toml
+++ b/lexical-write-float/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical-write-float"
readme = "README.md"
repository = "https://github.com/Alexhuszag... | 1 | 1 | 1 |
33c6ed317c92454a10b986e63c8a08ecb96e4941 | Alex Huszagh | 2024-09-25T00:23:04 | Fix parse float version. | diff --git a/lexical-parse-float/Cargo.toml b/lexical-parse-float/Cargo.toml
index 7ef5bd5..528209b 100644
--- a/lexical-parse-float/Cargo.toml
+++ b/lexical-parse-float/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical-parse-float"
readme = "README.md"
repository = "https://github.com/Alexhuszag... | 1 | 1 | 1 |
9eeedfe8f251dd0258e876b6a1f72efc65a29666 | Alex Huszagh | 2024-09-19T23:12:08 | Patch issue with incorrect parsing of leading zeros.
This affects integers where they have a leading 0 followed by a
non-digit character when the format API is enabled and for non-partial
parsers. This should return an error. Tests have been introduced to
avoid regressions.
Closes #98 | diff --git a/lexical-parse-float/tests/issue_98_tests.rs b/lexical-parse-float/tests/issue_98_tests.rs
new file mode 100644
index 0000000..ee137b8
--- /dev/null
+++ b/lexical-parse-float/tests/issue_98_tests.rs
@@ -0,0 +1,67 @@
+#![cfg(all(feature = "power-of-two", feature = "format"))]
+
+use std::assert_eq;
+
+use le... | 3 | 142 | 4 |
21021cb61ca9bd18031b83e7efa897c4b4ed2dc2 | Alex Huszagh | 2024-09-16T21:48:01 | Increment the itoa benchmark versions. | diff --git a/lexical-benchmark/input.rs b/lexical-benchmark/input.rs
index 3bad58d..abf6f33 100644
--- a/lexical-benchmark/input.rs
+++ b/lexical-benchmark/input.rs
@@ -449,16 +449,11 @@ macro_rules! ryu_generator {
macro_rules! itoa_generator {
($group:ident, $name:expr, $iter:expr) => {{
- use lexical_... | 2 | 3 | 8 |
5b4224f0fc0f67219c04cc993fc4b5c4b5f24441 | Alex Huszagh | 2024-09-18T02:32:08 | Make the parse float benches more descriptive. | diff --git a/lexical-benchmark/parse-float/canada.rs b/lexical-benchmark/parse-float/canada.rs
index 11d1b13..643d910 100644
--- a/lexical-benchmark/parse-float/canada.rs
+++ b/lexical-benchmark/parse-float/canada.rs
@@ -13,7 +13,8 @@ fn canada(criterion: &mut Criterion) {
group.measurement_time(Duration::from_sec... | 3 | 6 | 3 |
df1a897285445e114b2232340b079e7d82125660 | Andrey Zheleznov | 2024-09-17T07:10:08 | Make inlining consistent between API methods.
Closes #145. | diff --git a/lexical-parse-integer/src/api.rs b/lexical-parse-integer/src/api.rs
index 9240212..5cc08eb 100644
--- a/lexical-parse-integer/src/api.rs
+++ b/lexical-parse-integer/src/api.rs
@@ -15,16 +15,14 @@ use crate::parse::ParseInteger;
/// can actually be evaluated at compile-time, which causes major branching
/... | 3 | 10 | 17 |
fd3baac52d87b3253bd46669a498140bf2886833 | Alex Huszagh | 2024-09-16T12:55:32 | Fix links in docs. | diff --git a/lexical-util/src/lib.rs b/lexical-util/src/lib.rs
index 7533e01..fe3af03 100644
--- a/lexical-util/src/lib.rs
+++ b/lexical-util/src/lib.rs
@@ -55,7 +55,7 @@
//! correctly.
//!
//! To see if the cursor is at the end of the buffer, use
-//! [is_buffer_empty][crate::iterator::Iter::is_buffer_empty].
+//! ... | 1 | 4 | 4 |
559a1cf54fe1a243cc7534bf367205f6decba72e | Alex Huszagh | 2024-09-15T22:49:50 | Don't worry about skipping checks with an overallocated buffer. | diff --git a/lexical-parse-float/src/bigint.rs b/lexical-parse-float/src/bigint.rs
index 2e9fa6b..0738f0a 100644
--- a/lexical-parse-float/src/bigint.rs
+++ b/lexical-parse-float/src/bigint.rs
@@ -586,8 +586,7 @@ impl<const SIZE: usize> StackVec<SIZE> {
pub fn from_u16(x: u16) -> Self {
let mut vec = Self... | 1 | 5 | 11 |
222009ecaddb6480171b3f1158c02e94f5a04f68 | Alex Huszagh | 2024-09-15T21:40:29 | Fix some performance regressions (#140). | diff --git a/lexical-util/src/iterator.rs b/lexical-util/src/iterator.rs
index 396d1b0..d14c5aa 100644
--- a/lexical-util/src/iterator.rs
+++ b/lexical-util/src/iterator.rs
@@ -143,19 +143,13 @@ pub unsafe trait Iter<'a> {
/// sensitivity.
#[inline(always)]
fn first_is(&mut self, value: u8, is_cased: boo... | 2 | 15 | 19 |
efb7a1b9c3b1257ec9974df25964db56c0da7f5f | Alex Huszagh | 2024-09-15T18:59:58 | Add in some better conventions, refactor more to safe fns. | diff --git a/lexical-parse-float/src/parse.rs b/lexical-parse-float/src/parse.rs
index b8fe3c1..56fc77d 100644
--- a/lexical-parse-float/src/parse.rs
+++ b/lexical-parse-float/src/parse.rs
@@ -618,7 +618,8 @@ pub fn parse_partial_number<'a, const FORMAT: u128>(
let mut implicit_exponent: i64;
let int_end = n_... | 4 | 34 | 49 |
b21ffcccf6013091295a3ad373cb5c0fcede94a2 | Alex Huszagh | 2024-09-15T18:47:55 | Improve some naming conventions, etc. | diff --git a/lexical-util/src/iterator.rs b/lexical-util/src/iterator.rs
index 0b77b2f..d3bd8f8 100644
--- a/lexical-util/src/iterator.rs
+++ b/lexical-util/src/iterator.rs
@@ -31,12 +31,53 @@ pub unsafe trait Iter<'a> {
/// Determine if the buffer is contiguous in memory.
const IS_CONTIGUOUS: bool;
+ //... | 3 | 364 | 386 |
fbeb026ae7881523a8c0b3e63ee670fb44f47044 | Alex Huszagh | 2024-09-15T17:35:32 | Add some better naming conventions and plan to migrate for less unsafe code. | diff --git a/lexical-parse-float/src/binary.rs b/lexical-parse-float/src/binary.rs
index f3fcf5e..1c92e7c 100644
--- a/lexical-parse-float/src/binary.rs
+++ b/lexical-parse-float/src/binary.rs
@@ -10,7 +10,7 @@
use lexical_parse_integer::algorithm;
use lexical_util::digit::char_to_valid_digit_const;
use lexical_util... | 12 | 220 | 250 |
aeab32205c18c4569402f83817eeb9fb983ee64b | Alex Huszagh | 2024-09-15T00:48:57 | Ensure all package versions internally are properly incremented. | diff --git a/lexical-core/Cargo.toml b/lexical-core/Cargo.toml
index 3c04ad0..0777a4c 100644
--- a/lexical-core/Cargo.toml
+++ b/lexical-core/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical-core"
readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-lexical"
-version = "1.0.0"
... | 3 | 4 | 4 |
7df1e74b56ecc516b75637c1660422e301c956aa | Alex Huszagh | 2024-09-14T22:41:09 | Make clippy happy (they deserve it). | diff --git a/lexical-benchmark/parse-float/black_box.rs b/lexical-benchmark/parse-float/black_box.rs
index 3c283c1..92641a5 100644
--- a/lexical-benchmark/parse-float/black_box.rs
+++ b/lexical-benchmark/parse-float/black_box.rs
@@ -10,4 +10,4 @@ pub fn black_box(mut dummy: f64) -> f64 {
);
dummy
... | 2 | 3 | 2 |
a2434f04d6788dcc003ff06c2f9382b5ab8f0fb3 | Alex Huszagh | 2024-09-14T20:09:22 | Minor refactoring that mostly improves performance.
One specific benchmark however has significant regressions, the
random:big_ints/write_f32_lexical benchmark, while the f64 version does
not. The benchmark is still considerably faster than ryu or fmt,
however. | diff --git a/lexical-write-float/src/algorithm.rs b/lexical-write-float/src/algorithm.rs
index 5947d6e..602c169 100644
--- a/lexical-write-float/src/algorithm.rs
+++ b/lexical-write-float/src/algorithm.rs
@@ -79,6 +79,7 @@ pub fn write_float<F: RawFloat, const FORMAT: u128>(
}
/// Write float to string in scientifi... | 4 | 64 | 107 |
b2da5f5d64bcde39ee25c3e423ed5345c20e9460 | Alex Huszagh | 2024-09-14T19:27:01 | Remove further unsafety from the overall API.
This is a relatively trivial change and causes a small performance hit, but that change should be able to be mitigated with some minor refactoring. | diff --git a/lexical-write-float/src/algorithm.rs b/lexical-write-float/src/algorithm.rs
index fc8a11e..5947d6e 100644
--- a/lexical-write-float/src/algorithm.rs
+++ b/lexical-write-float/src/algorithm.rs
@@ -41,12 +41,6 @@ use crate::shared;
use crate::table::*;
/// Optimized float-to-string algorithm for decimal ... | 3 | 10 | 22 |
4f6a67ab64fa497016fef95406926bf477576690 | Alex Huszagh | 2024-09-14T19:12:43 | Remove all remaining potential unsoundness in the decimal writer.
This in general for simple cases due to slight refactoring improves performance, however, it does have a noticeable (+2-7%) penalty in some corner cases which invoke the close-to-halfway rounding cases. That said, performance of this implementation of t... | diff --git a/lexical-write-float/src/algorithm.rs b/lexical-write-float/src/algorithm.rs
index 0ad05aa..fc8a11e 100644
--- a/lexical-write-float/src/algorithm.rs
+++ b/lexical-write-float/src/algorithm.rs
@@ -48,7 +48,7 @@ use crate::table::*;
/// is large enough to hold the significant digits.
// TODO: Migrate to sa... | 4 | 92 | 139 |
41fd62a3d468def52ccc85c56a9a0510bf73b654 | Alex Huszagh | 2024-09-14T18:39:50 | Migrate to much more safe code.
This causes ~0.5-1% regression in performance but this is well within an
acceptable range for better safety guarantees. Most of the bounds
checking is ellided by the compiler. | diff --git a/lexical-write-float/src/algorithm.rs b/lexical-write-float/src/algorithm.rs
index 11c285e..0ad05aa 100644
--- a/lexical-write-float/src/algorithm.rs
+++ b/lexical-write-float/src/algorithm.rs
@@ -102,13 +102,11 @@ pub unsafe fn write_float_scientific<F: DragonboxFloat, const FORMAT: u128>(
// Write th... | 2 | 12 | 26 |
ac23885ffb920ca83aa56eb7a1d17c1ea4013528 | Alex Huszagh | 2024-09-14T18:08:05 | Remove more unsafe code. | diff --git a/lexical-write-float/src/algorithm.rs b/lexical-write-float/src/algorithm.rs
index 58b4439..11c285e 100644
--- a/lexical-write-float/src/algorithm.rs
+++ b/lexical-write-float/src/algorithm.rs
@@ -65,6 +65,7 @@ pub unsafe fn write_float<F: RawFloat, const FORMAT: u128>(
// and write the significant dig... | 2 | 34 | 21 |
e919a4171edfc7ee19b9ba5d19dc3482fa571368 | Alex Huszagh | 2024-09-14T17:14:18 | Make the dragonbox algorithm safe.
This converts the core dragonbox algorithm for the float decimal writers
to be completely safe. This ensures effectively all non-trivial uses of
unsafe that could cause unsoundness are removed for 99% of users. | diff --git a/lexical-benchmark/write-float/special.rs b/lexical-benchmark/write-float/special.rs
index d896162..36fa15b 100644
--- a/lexical-benchmark/write-float/special.rs
+++ b/lexical-benchmark/write-float/special.rs
@@ -19,6 +19,7 @@ macro_rules! gen_vec {
let value = fastrand::$i($exp_mask..);
... | 6 | 64 | 78 |
1a76b3235f593ec4160e112f202e6fc60f18cf63 | Alex Huszagh | 2024-09-14T16:38:10 | Add better handling of -0 floats. | diff --git a/lexical-util/src/num.rs b/lexical-util/src/num.rs
index 5f32d65..522ba0b 100644
--- a/lexical-util/src/num.rs
+++ b/lexical-util/src/num.rs
@@ -713,6 +713,15 @@ pub trait Float: Number + ops::Neg<Output = Self> {
!self.is_odd()
}
+ /// Returns true if the float needs a negative sign when... | 5 | 51 | 40 |
6b5811ca127afb42954a51844333e0d7a999f34e | Alex Huszagh | 2024-09-14T15:38:33 | Add a benchmark for writing special numbers. | diff --git a/lexical-benchmark/write-float/Cargo.toml b/lexical-benchmark/write-float/Cargo.toml
index 1543c3c..8cf0141 100644
--- a/lexical-benchmark/write-float/Cargo.toml
+++ b/lexical-benchmark/write-float/Cargo.toml
@@ -44,3 +44,8 @@ harness = false
name = "random"
path = "random.rs"
harness = false
+
+[[bench]... | 2 | 52 | 0 |
e25ce93ae9dc96921668c4bfedfe201c012b7340 | Alex Huszagh | 2024-09-14T00:31:36 | Document more safety invariants. | diff --git a/lexical-core/src/lib.rs b/lexical-core/src/lib.rs
index 44021bf..697d818 100644
--- a/lexical-core/src/lib.rs
+++ b/lexical-core/src/lib.rs
@@ -296,6 +296,7 @@
//! - [Parsing Integers](https://github.com/Alexhuszagh/rust-lexical/blob/main/lexical-parse-integer/docs/Benchmarks.md)
//! - [Writing Floats](h... | 6 | 23 | 9 |
ff2cf9f90677c9c69a7d469034717ba714b7f99a | Alex Huszagh | 2024-09-13T23:57:43 | Fix correctness issue with skip iterators and short integer optimizations. | diff --git a/lexical-parse-integer/src/algorithm.rs b/lexical-parse-integer/src/algorithm.rs
index 79f3a82..8afce7b 100644
--- a/lexical-parse-integer/src/algorithm.rs
+++ b/lexical-parse-integer/src/algorithm.rs
@@ -90,11 +90,16 @@ macro_rules! into_error {
/// Handle an invalid digit if the format feature is enabled... | 1 | 27 | 14 |
38a916e7405e14fa7a8136d164e14364000c37bf | Alex Huszagh | 2024-09-13T23:37:50 | Fix unspecified behavior in LLVM and UB in Rust.
Lexical itself used a high-level vector which is then directly cast to a
String using uninitialized memory under the hood. Since the behavior
never relied on the values of the reads, this wasn't ever seen as an issue,
however, anything besides using `ptr::write` can inv... | diff --git a/lexical-core/src/lib.rs b/lexical-core/src/lib.rs
index da9e8cb..44021bf 100644
--- a/lexical-core/src/lib.rs
+++ b/lexical-core/src/lib.rs
@@ -104,29 +104,29 @@
//!
//! A complete description of supported features includes:
//!
-//! ### std
+//! #### std
//!
//! Enable use of the standard library. Cu... | 2 | 82 | 54 |
1641a9ea96001a1577cd1594332ca01285dc98d4 | Alex Huszagh | 2024-09-13T12:07:51 | Remove MaybeUninit for our integer writers entirely. | diff --git a/lexical-size/bin/write.rs b/lexical-size/bin/write.rs
index 1d4cfe0..1db5051 100644
--- a/lexical-size/bin/write.rs
+++ b/lexical-size/bin/write.rs
@@ -26,6 +26,8 @@ macro_rules! integer_module {
#[cfg(feature = "lexical")]
{
+ // FIXME: This is UB but it doesn't ... | 5 | 30 | 61 |
0ac2c921ad5d22dde1e8c28eb27a737a2e023991 | Alex Huszagh | 2024-09-12T05:04:38 | Ensure static buffer assertions are core.
[skip ci] | diff --git a/lexical-write-float/tests/algorithm_tests.rs b/lexical-write-float/tests/algorithm_tests.rs
index 588fb54..5c47f49 100644
--- a/lexical-write-float/tests/algorithm_tests.rs
+++ b/lexical-write-float/tests/algorithm_tests.rs
@@ -223,7 +223,7 @@ fn write_digits_f32(buffer: &mut [u8], value: u64, expected: &s... | 2 | 6 | 6 |
249c2cf4a5ba3e3c3099c7e2e36aad778314f7f8 | Alex Huszagh | 2024-09-12T04:37:45 | Fix our linter. | diff --git a/lexical-parse-integer/tests/algorithm_tests.rs b/lexical-parse-integer/tests/algorithm_tests.rs
index 78a625f..14f24a3 100644
--- a/lexical-parse-integer/tests/algorithm_tests.rs
+++ b/lexical-parse-integer/tests/algorithm_tests.rs
@@ -122,7 +122,9 @@ fn test_try_parse_8digits() {
#[cfg(feature = "power-o... | 1 | 3 | 1 |
866a42006e7dc0869019899218724dada3c44ac1 | Alex Huszagh | 2024-09-12T04:24:51 | Make multi-digit optimizations optional. | diff --git a/lexical-parse-integer/src/algorithm.rs b/lexical-parse-integer/src/algorithm.rs
index 3d049d9..55c4704 100644
--- a/lexical-parse-integer/src/algorithm.rs
+++ b/lexical-parse-integer/src/algorithm.rs
@@ -32,6 +32,7 @@
#![doc(hidden)]
+use crate::Options;
use lexical_util::buffer::Buffer;
use lexical... | 5 | 126 | 36 |
dea8e9da79c3a30a30f682125740d88abb367aca | Alex Huszagh | 2024-09-12T03:13:03 | Minor correctness patches for corner cases. | diff --git a/lexical-parse-float/src/binary.rs b/lexical-parse-float/src/binary.rs
index 4b76a03..9e3d414 100644
--- a/lexical-parse-float/src/binary.rs
+++ b/lexical-parse-float/src/binary.rs
@@ -106,9 +106,8 @@ pub fn parse_u64_digits<'a, Iter, const FORMAT: u128>(
// Try to parse 8 digits at a time, if we can.
... | 6 | 44 | 33 |
13194a5cb2184b38e480ebcdc23bff27fab68098 | Alex Huszagh | 2024-09-11T03:03:03 | Minor performance tweaks. | diff --git a/lexical-parse-float/src/parse.rs b/lexical-parse-float/src/parse.rs
index b9a78c7..b60d13c 100644
--- a/lexical-parse-float/src/parse.rs
+++ b/lexical-parse-float/src/parse.rs
@@ -158,35 +158,85 @@ parse_float_as_f32! { bf16 f16 }
// different internally. Most of the code is reshared, so the duplicated
... | 1 | 71 | 13 |
62d3c21669126b4ceca54e547859ee7c8dfdcbec | Alex Huszagh | 2024-09-10T22:46:51 | Add in peak, read_if helpers and migrate to guaranteed safety variants. | diff --git a/lexical-parse-float/src/bigint.rs b/lexical-parse-float/src/bigint.rs
index 0459264..1cd5d68 100644
--- a/lexical-parse-float/src/bigint.rs
+++ b/lexical-parse-float/src/bigint.rs
@@ -1178,7 +1178,7 @@ pub fn long_mul<const SIZE: usize>(x: &[Limb], y: &[Limb]) -> Option<StackVec<SI
// frequent realloc... | 6 | 82 | 79 |
862d5df07626427898f2ce13358fc814dba4f5b3 | Alex Huszagh | 2024-09-10T19:48:02 | Remove length then unsafe index with get(0).
Seems to improve performance on some edge case floats invoking this path
by up to 30%. | diff --git a/lexical-parse-float/src/bigint.rs b/lexical-parse-float/src/bigint.rs
index 552458c..0459264 100644
--- a/lexical-parse-float/src/bigint.rs
+++ b/lexical-parse-float/src/bigint.rs
@@ -574,8 +574,9 @@ impl<const SIZE: usize> StackVec<SIZE> {
#[inline(always)]
pub fn from_u32(x: u32) -> Self {
... | 1 | 13 | 13 |
7f634f9aecdc691a717a1e7ce68a7385185e4e83 | Alex Huszagh | 2024-09-10T13:00:20 | Remove most unsafety in big int.
The safety guarantees that aren't validated immediately have been
removed (so only keeping the unsafe code in the hi bit extraction, which
is checked right in the call), and this leads to ~3% degradation in
performance in the worst cases, which is still 90% faster than core so
it's wel... | diff --git a/lexical-parse-float/src/bigint.rs b/lexical-parse-float/src/bigint.rs
index b26478d..552458c 100644
--- a/lexical-parse-float/src/bigint.rs
+++ b/lexical-parse-float/src/bigint.rs
@@ -257,10 +257,11 @@ pub struct StackVec<const SIZE: usize> {
}
/// Extract the hi bits from the buffer.
+///
+/// NOTE: M... | 2 | 81 | 64 |
b8fcf5135588c6616b13663457fca3860765fef7 | Alex Huszagh | 2024-09-10T05:41:52 | Remove unused unsafe. | diff --git a/lexical-parse-float/src/number.rs b/lexical-parse-float/src/number.rs
index 63f2cff..deba75c 100644
--- a/lexical-parse-float/src/number.rs
+++ b/lexical-parse-float/src/number.rs
@@ -73,23 +73,19 @@ impl<'a> Number<'a> {
// normal fast path
let value = F::as_cast(self.man... | 7 | 60 | 86 |
a4e748067024f16dc4b61142c29dc4acd7e6cd92 | Alex Huszagh | 2024-09-10T01:41:52 | Remove all unsafety from our table API methods. | diff --git a/lexical-benchmark/algorithm/bigint.rs b/lexical-benchmark/algorithm/bigint.rs
index 975b01d..0a97b63 100644
--- a/lexical-benchmark/algorithm/bigint.rs
+++ b/lexical-benchmark/algorithm/bigint.rs
@@ -26,7 +26,7 @@ fn small_pow(big: &mut bigint::Bigint, mut exp: u32) {
}
if exp != 0 {
// ... | 12 | 83 | 174 |
b07e866eef611e9f42537b92e917082da5ecc746 | Alex Huszagh | 2024-09-09T16:21:37 | Ensure BytesIter is an unsafe trait.
Closes #104
Part of fixes to address #100 | diff --git a/lexical-util/src/iterator.rs b/lexical-util/src/iterator.rs
index 149ab92..34211ac 100644
--- a/lexical-util/src/iterator.rs
+++ b/lexical-util/src/iterator.rs
@@ -20,7 +20,13 @@ pub use crate::skip::{AsBytes, Bytes};
/// A default implementation is provided for slice iterators.
/// This trait **should n... | 3 | 12 | 6 |
b0c9e640228738e430c7d9975e10bf9402941759 | Alex Huszagh | 2024-09-09T01:19:52 | Restore the dtoa benchmarks. | diff --git a/lexical-benchmark/input.rs b/lexical-benchmark/input.rs
index 2936f43..2bc1048 100644
--- a/lexical-benchmark/input.rs
+++ b/lexical-benchmark/input.rs
@@ -399,8 +399,8 @@ macro_rules! dtoa_generator {
$group.bench_function($name, |bench| {
bench.iter(|| {
$iter.for_e... | 1 | 3 | 4 |
3f6b344c4f1456b8f50b11e0454abf67bf8c51e7 | Alex Huszagh | 2024-09-08T22:10:33 | Add missing read_u32 and read_u64 to trait. | diff --git a/lexical-util/src/skip.rs b/lexical-util/src/skip.rs
index 540e39a..a6d8f6a 100644
--- a/lexical-util/src/skip.rs
+++ b/lexical-util/src/skip.rs
@@ -700,8 +700,13 @@ macro_rules! skip_iterator_byteiter_base {
}
#[inline]
- fn read<V>(&self) -> Option<V> {
- self.byte.re... | 1 | 7 | 2 |
0bfe843068e9501d6ffcdf26c230367acca665bf | John-John Tedro | 2024-04-26T12:10:37 | Don't extern alloc unless needed | diff --git a/lexical/src/lib.rs b/lexical/src/lib.rs
index bcdbb2e..27570b1 100644
--- a/lexical/src/lib.rs
+++ b/lexical/src/lib.rs
@@ -271,17 +271,13 @@
#![cfg_attr(not(feature = "std"), no_std)]
// Need an allocator for String/Vec.
-#[cfg(not(feature = "std"))]
+#[cfg(feature = "write")]
extern crate alloc;
-... | 1 | 3 | 7 |
6613e7ac13c8f072850c83a76f64240e35e93c85 | Burke Libbey | 2024-03-12T15:40:58 | Ruby float literal format improvements:
* Ruby floats are always formatted with an exponent sign.
* Ruby floats break to scientific at e-4.
* Ruby floats break to scientific at e14 (approximately).
* Ruby uses "Infinity" and "NaN", but "Infinity".to_f and "NaN".to_f are 0
The true behaviour for the positive exponent ... | diff --git a/lexical-parse-float/src/options.rs b/lexical-parse-float/src/options.rs
index c05bf54..14f8154 100644
--- a/lexical-parse-float/src/options.rs
+++ b/lexical-parse-float/src/options.rs
@@ -602,20 +602,21 @@ const_assert!(CXX_LITERAL.is_valid());
#[rustfmt::skip]
pub const RUBY_LITERAL: Options = unsafe {
... | 4 | 18 | 11 |
2680d09a5c4523af9d8ed0804fec82e0d281c0a9 | Manish Goregaokar | 2023-07-25T19:28:17 | Remove read(), add read_u32() and read_u64() and use everywhere | diff --git a/lexical-parse-float/src/slow.rs b/lexical-parse-float/src/slow.rs
index 26a0d90..3cba04b 100644
--- a/lexical-parse-float/src/slow.rs
+++ b/lexical-parse-float/src/slow.rs
@@ -335,7 +335,7 @@ macro_rules! round_up_nonzero {
// First try reading 8-digits at a time.
if iter.is_contiguous(... | 5 | 52 | 18 |
fb064d928cf44357162c2d3070b072134d5e9546 | Manish Goregaokar | 2023-07-10T13:19:22 | Use ?-deps for lexical-core's metafeatures | diff --git a/lexical-core/Cargo.toml b/lexical-core/Cargo.toml
index ec5d109..a1cf387 100644
--- a/lexical-core/Cargo.toml
+++ b/lexical-core/Cargo.toml
@@ -72,66 +72,66 @@ parse-floats = ["lexical-parse-float", "parse", "floats"]
# Add support for parsing power-of-two float strings.
power-of-two = [
"lexical-ut... | 1 | 32 | 32 |
09c686b075096d48155cfb32265068f962afc56c | Alex Huszagh | 2022-06-06T16:47:32 | Fix lint for range contains. | diff --git a/lexical-parse-float/src/lemire.rs b/lexical-parse-float/src/lemire.rs
index 63f49ef..7f6501c 100644
--- a/lexical-parse-float/src/lemire.rs
+++ b/lexical-parse-float/src/lemire.rs
@@ -85,7 +85,7 @@ pub fn compute_float<F: LemireFloat>(q: i64, mut w: u64, lossy: bool) -> Extende
// <https://arxiv.o... | 1 | 1 | 1 |
933e2cca11736fc230ba7c3cbbad58bb58a89d13 | Alex Huszagh | 2022-06-06T16:37:08 | Increment version for release. | diff --git a/lexical-parse-integer/Cargo.toml b/lexical-parse-integer/Cargo.toml
index 015c223..cd55c17 100644
--- a/lexical-parse-integer/Cargo.toml
+++ b/lexical-parse-integer/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical-parse-integer"
readme = "README.md"
repository = "https://github.com/... | 1 | 1 | 1 |
71624c3e49a8eb7b37eb591ca8c605696d8c0b33 | Alex Huszagh | 2022-06-06T16:33:43 | Fix return of negative integers with partial parser.
Previously, numbers such as `-1a` would return `Ok((1, 2))` from the
partial parser, because the wrapping, negative value wasn't handled.
This changes it to correctly return `Ok((-1, 2))`.
Closes #86. | diff --git a/lexical-parse-integer/src/shared.rs b/lexical-parse-integer/src/shared.rs
index 41e3ca4..fff53f5 100644
--- a/lexical-parse-integer/src/shared.rs
+++ b/lexical-parse-integer/src/shared.rs
@@ -86,6 +86,8 @@ macro_rules! invalid_digit_partial {
} else {
into_error!(Overflow, (co... | 2 | 7 | 0 |
17dca4a1bfefa7b8593be71d49775a3f259e3f5a | Alex Huszagh | 2022-05-18T19:59:51 | Update lexical version. | diff --git a/lexical/Cargo.toml b/lexical/Cargo.toml
index 378b1b0..d63a5d6 100644
--- a/lexical/Cargo.toml
+++ b/lexical/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical"
readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-lexical"
-version = "6.1.0"
+version = "6.1.1"
exclu... | 1 | 1 | 1 |
1dd90f1d52d47c9fe2a2bf43d59a7e17f0459a12 | Xiphoseer | 2022-05-14T21:25:04 | Suppress some lints that trigger don't trigger in all cfg's | diff --git a/lexical-benchmark/input.rs b/lexical-benchmark/input.rs
index 642e69a..b43fc40 100644
--- a/lexical-benchmark/input.rs
+++ b/lexical-benchmark/input.rs
@@ -90,6 +90,7 @@ macro_rules! json_data {
}
/// Generate an array of values as static data
+#[allow(unknown_lints, unused_macro_rules)]
macro_rules! ... | 3 | 5 | 0 |
0fdaa9fd42503c4a9afdba727c8a014e49496d3c | Alex Huszagh | 2022-05-15T16:05:48 | Fix lint issue in issue84 unittest. | diff --git a/lexical-write-float/tests/algorithm_tests.rs b/lexical-write-float/tests/algorithm_tests.rs
index 37e76e0..588fb54 100644
--- a/lexical-write-float/tests/algorithm_tests.rs
+++ b/lexical-write-float/tests/algorithm_tests.rs
@@ -93,7 +93,8 @@ fn floor_log10_pow2_minus_log10_4_over_3_test() {
#[test]
fn ... | 1 | 2 | 1 |
13df1ef52ebc7579d0ec23694bb42dbdb3aca0b7 | Alex Huszagh | 2022-05-14T22:37:53 | Fix arithmetic overflow in umul192_lower128.
Doesn't affect release builds, but extracting the mid 64 bits in
`umul192_lower128` leads to arithmetic overflow in `hi + (hi_lo >> 64)
as u64`, causing an undesirable panic.
Closes #84. | diff --git a/lexical-write-float/src/algorithm.rs b/lexical-write-float/src/algorithm.rs
index 52cb736..f3a1fb4 100644
--- a/lexical-write-float/src/algorithm.rs
+++ b/lexical-write-float/src/algorithm.rs
@@ -874,7 +874,8 @@ pub const fn umul192_upper128(x: u64, hi: u64, lo: u64) -> (u64, u64) {
pub const fn umul192_l... | 2 | 9 | 1 |
effaae863913b2f78e6d4ec0fb4fc6fac72637d1 | Alex Huszagh | 2022-05-14T22:13:24 | Fix unknown lint warnings.
`unused_macro_rules` isn't known prior to nightly-2022-05-12, so we
allow unknown lints so we don't receive a spurious warning. | diff --git a/lexical-benchmark/input.rs b/lexical-benchmark/input.rs
index 5b6d6c8..642e69a 100644
--- a/lexical-benchmark/input.rs
+++ b/lexical-benchmark/input.rs
@@ -1,7 +1,8 @@
//! Input data reader and random-number generator for benchmarks.
//! This is adapted from fast-float-rust.
-#![allow(dead_code, unused... | 2 | 3 | 3 |
8527701afcddb6e3d97e0b75696e69e9ee50c38a | Alex Huszagh | 2022-05-14T21:45:47 | Remove unused field warnings in test-parse-unittests.
The fields `UID` and `int` are not used, however, they are part of the
file format and should not be removed. | diff --git a/lexical-parse-float/etc/correctness/test-parse-unittests/main.rs b/lexical-parse-float/etc/correctness/test-parse-unittests/main.rs
index cc971cc..1399285 100644
--- a/lexical-parse-float/etc/correctness/test-parse-unittests/main.rs
+++ b/lexical-parse-float/etc/correctness/test-parse-unittests/main.rs
@@ ... | 1 | 2 | 0 |
5c2732c00f998b529e049f578a1566098ba26df3 | Alex Huszagh | 2022-05-14T21:14:40 | Fix lint checks with newer rustc versions.
Fix rustfmt and clippy checks up to nightly-2022-05-12. | diff --git a/lexical-benchmark/input.rs b/lexical-benchmark/input.rs
index a541aed..5b6d6c8 100644
--- a/lexical-benchmark/input.rs
+++ b/lexical-benchmark/input.rs
@@ -1,7 +1,7 @@
//! Input data reader and random-number generator for benchmarks.
//! This is adapted from fast-float-rust.
-#![allow(dead_code, unused... | 5 | 15 | 24 |
6b92f7ed4f52a087e6f10656df3f088f88a7b5c6 | Xiphoseer | 2022-05-14T20:20:43 | lexical-write-float-correctness: run cargo fmt | diff --git a/lexical-write-float/etc/correctness/dragonbox/random.rs b/lexical-write-float/etc/correctness/dragonbox/random.rs
index 93cac05..2d49756 100644
--- a/lexical-write-float/etc/correctness/dragonbox/random.rs
+++ b/lexical-write-float/etc/correctness/dragonbox/random.rs
@@ -7,7 +7,7 @@ mod roundtrip;
use c... | 3 | 6 | 6 |
0385ea32733a2494f31392c493cda238d3dacdcb | Xiphoseer | 2022-05-14T19:33:03 | Updated clap version in write-float correctness tests | diff --git a/lexical-write-float/etc/correctness/Cargo.toml b/lexical-write-float/etc/correctness/Cargo.toml
index ae831f8..8414e45 100644
--- a/lexical-write-float/etc/correctness/Cargo.toml
+++ b/lexical-write-float/etc/correctness/Cargo.toml
@@ -15,8 +15,11 @@ path = "../../../lexical-util"
default-features = false... | 4 | 8 | 6 |
726b03fa4ae44fca27ee220b93590ad4b6a72de2 | Daniel Seiler | 2022-05-14T18:30:32 | Fixed word in function comment | diff --git a/lexical-util/src/format_builder.rs b/lexical-util/src/format_builder.rs
index aa14566..cc3648d 100644
--- a/lexical-util/src/format_builder.rs
+++ b/lexical-util/src/format_builder.rs
@@ -258,7 +258,7 @@ impl NumberFormatBuilder {
Self::from_radix(8)
}
- /// Create number format for stan... | 1 | 1 | 1 |
cf3daf06ce8c2ba8d26bcc9eaca8b8b967ff4d40 | Alex Huszagh | 2022-03-15T17:34:26 | Bug fixes to the updated to_decimal algorithm. | diff --git a/lexical-write-float/src/algorithm.rs b/lexical-write-float/src/algorithm.rs
index a2796cb..52cb736 100644
--- a/lexical-write-float/src/algorithm.rs
+++ b/lexical-write-float/src/algorithm.rs
@@ -466,8 +466,9 @@ pub fn compute_nearest_shorter<F: RawFloat>(float: F) -> ExtendedFloat80 {
let lower_thres... | 1 | 121 | 112 |
2119919cb6d22a2fab2da2c30df211662750ff03 | Alex Huszagh | 2022-03-10T19:07:59 | Updated unittests for release. | diff --git a/lexical-parse-integer/tests/algorithm_tests.rs b/lexical-parse-integer/tests/algorithm_tests.rs
index 9384e1a..e8b7d9d 100644
--- a/lexical-parse-integer/tests/algorithm_tests.rs
+++ b/lexical-parse-integer/tests/algorithm_tests.rs
@@ -118,6 +118,7 @@ fn test_try_parse_8digits() {
assert_eq!(parse(b"1... | 1 | 1 | 0 |
63d2857856fce6104b65e58a2ccd893732ebc35d | Alex Huszagh | 2022-03-10T17:28:02 | Added `from_radix` functions to simplify creating options.
- Added `from_radix` for options in `lexical-write-float` and
`lexical-parse-float`. | diff --git a/lexical-parse-float/src/options.rs b/lexical-parse-float/src/options.rs
index 88f1a70..c05bf54 100644
--- a/lexical-parse-float/src/options.rs
+++ b/lexical-parse-float/src/options.rs
@@ -340,6 +340,21 @@ impl Options {
unsafe { Self::builder().build_unchecked() }
}
+ /// Create the defa... | 2 | 30 | 0 |
efcb7f6614bcad7510b96e01e4f6228b857a9f40 | Alex Huszagh | 2022-03-10T17:11:37 | Bug fix for parsing floats with radixes >= 10 when `radix` is not enabled.
This only applies when radix is 16 or 32 when the `power-of-two` feature
is enabled. | diff --git a/lexical-parse-float/src/shared.rs b/lexical-parse-float/src/shared.rs
index c5be384..4e34690 100644
--- a/lexical-parse-float/src/shared.rs
+++ b/lexical-parse-float/src/shared.rs
@@ -15,7 +15,7 @@ use lexical_util::num::AsPrimitive;
#[cfg(not(feature = "compact"))]
macro_rules! can_try_parse_8digits {
... | 2 | 13 | 1 |
3cae06e9b591265b218fcfe47b31d609c8b22590 | Alex Huszagh | 2022-03-03T02:19:01 | Added fixes for #76.
In `slice_fill_unchecked`, ensure we calculate the length of the slice
prior to filling the slice, since the slice expression might be complex,
which would lead to (spurious) warnings of stacked borrows. | diff --git a/lexical-write-float/src/index.rs b/lexical-write-float/src/index.rs
index a562c67..0d6090f 100644
--- a/lexical-write-float/src/index.rs
+++ b/lexical-write-float/src/index.rs
@@ -39,7 +39,10 @@ macro_rules! index_unchecked_mut {
#[cfg(not(feature = "safe"))]
macro_rules! slice_fill_unchecked {
($sl... | 1 | 4 | 1 |
a40541e838d32d7f41536216bedf7b17cdfabfae | Alex Huszagh | 2022-03-03T02:09:30 | Added fixes for #76.
Changed the logic for shifting right the digits by 1 for the decimal
point. Rather than use a general copy algorithm for overlapping regions,
we just use a for loop that gets optimized out by the compiler. | diff --git a/lexical-write-float/src/algorithm.rs b/lexical-write-float/src/algorithm.rs
index 23fa5b5..9b6eb42 100644
--- a/lexical-write-float/src/algorithm.rs
+++ b/lexical-write-float/src/algorithm.rs
@@ -289,13 +289,15 @@ pub unsafe fn write_float_positive_exponent<F: DragonboxFloat, const FORMAT: u12
}
... | 3 | 22 | 25 |
4a7dbff551c27945f19399c27f441d7dc0bfaef6 | Alex Huszagh | 2022-03-01T20:19:54 | Added inline hints and documentation for new methods. | diff --git a/lexical-parse-float/src/bigint.rs b/lexical-parse-float/src/bigint.rs
index f879041..97d14d3 100644
--- a/lexical-parse-float/src/bigint.rs
+++ b/lexical-parse-float/src/bigint.rs
@@ -298,10 +298,14 @@ impl<const SIZE: usize> StackVec<SIZE> {
}
}
+ /// Get a mutable ptr to the current st... | 1 | 4 | 0 |
dc30a8bd2b3c53f66506171c56cb370f9a7bc31f | Alex Huszagh | 2022-02-24T22:35:39 | Fix clippy lints without std. | diff --git a/lexical-util/src/num.rs b/lexical-util/src/num.rs
index 3162012..354dc48 100644
--- a/lexical-util/src/num.rs
+++ b/lexical-util/src/num.rs
@@ -1242,6 +1242,7 @@ fn floorf(x: f32) -> f32 {
* to produce the hexadecimal values shown.
*/
+#[allow(clippy::eq_op, clippy::excessive_precision)]
#[cfg(all(n... | 1 | 2 | 0 |
91fcadc9354db8661ebee422d0f8799829668c1b | Alex Huszagh | 2022-02-24T19:12:50 | Fix warnings for stabilized feature asm. | diff --git a/lexical-parse-float/src/lib.rs b/lexical-parse-float/src/lib.rs
index 01038c5..fad4ecb 100644
--- a/lexical-parse-float/src/lib.rs
+++ b/lexical-parse-float/src/lib.rs
@@ -80,6 +80,9 @@
//! - [Benchmarks](https://github.com/Alexhuszagh/rust-lexical/blob/main/lexical-parse-float/docs/Benchmarks.md)
//! - ... | 1 | 3 | 0 |
2fe1ab1d2d47ba02ac2674b74922901e2bd42423 | Alex Huszagh | 2022-02-24T18:54:02 | Fix for late init in writing float with custom radix. | diff --git a/lexical-write-float/src/radix.rs b/lexical-write-float/src/radix.rs
index 09a2118..6440fe4 100644
--- a/lexical-write-float/src/radix.rs
+++ b/lexical-write-float/src/radix.rs
@@ -220,12 +220,11 @@ pub unsafe fn write_float_scientific<const FORMAT: u128>(
let decimal_point = options.decimal_point();
... | 1 | 4 | 5 |
a7cfcaf1795f69c81d1a563543892b020184b2d9 | Alex Huszagh | 2022-02-24T18:48:06 | Fix for clippy warning on is_consumed. | diff --git a/lexical-util/src/iterator.rs b/lexical-util/src/iterator.rs
index 854aaa0..bb5f86d 100644
--- a/lexical-util/src/iterator.rs
+++ b/lexical-util/src/iterator.rs
@@ -50,6 +50,7 @@ pub trait BytesIter<'a>: Iterator<Item = &'a u8> {
///
/// This may advance the internal iterator state, but not
/... | 1 | 1 | 0 |
7e597cafa228b00db15437a9747d329b980e92fa | 5225225 | 2022-01-03T16:34:17 | WIP fixing miri (with -Zmiri-tag-raw-pointers) errors | diff --git a/lexical-parse-float/src/bigint.rs b/lexical-parse-float/src/bigint.rs
index 3293792..f879041 100644
--- a/lexical-parse-float/src/bigint.rs
+++ b/lexical-parse-float/src/bigint.rs
@@ -298,6 +298,14 @@ impl<const SIZE: usize> StackVec<SIZE> {
}
}
+ pub fn as_mut_ptr(&mut self) -> *mut Lim... | 2 | 19 | 5 |
dc9c09880d9d8f4860b1a1a101db871432bbc2fa | josfemova | 2021-12-14T23:49:51 | disable default features in lexical-util dependency for lexical-parse-float. close #72 | diff --git a/lexical-parse-float/Cargo.toml b/lexical-parse-float/Cargo.toml
index ad9bb90..62b0ea3 100644
--- a/lexical-parse-float/Cargo.toml
+++ b/lexical-parse-float/Cargo.toml
@@ -20,6 +20,7 @@ exclude = [
[dependencies.lexical-util]
version = "0.8"
path = "../lexical-util"
+default-features = false
features =... | 1 | 1 | 0 |
d70229d63e3cd073fe1fca093f81424d3c2fe246 | Alex Huszagh | 2021-10-04T10:38:33 | Fix documentation as per jk-jeon's suggestions.
Updates the documentation to ensure the dragonbox algorithm is properly described. Closes #67. | diff --git a/lexical-write-float/src/algorithm.rs b/lexical-write-float/src/algorithm.rs
index e6595e8..7a6c9ef 100644
--- a/lexical-write-float/src/algorithm.rs
+++ b/lexical-write-float/src/algorithm.rs
@@ -372,15 +372,15 @@ pub fn to_decimal<F: RawFloat>(float: F) -> ExtendedFloat80 {
// Toward zero case:
... | 1 | 8 | 20 |
cbb6d100038442379d785db52504d31d7c5fa3d2 | Alex Huszagh | 2021-09-30T15:41:28 | Address misleading comments in #67 (thanks @jk-jeon). | diff --git a/lexical-write-float/src/algorithm.rs b/lexical-write-float/src/algorithm.rs
index 38a79c9..67119ba 100644
--- a/lexical-write-float/src/algorithm.rs
+++ b/lexical-write-float/src/algorithm.rs
@@ -343,39 +343,32 @@ pub fn to_decimal<F: RawFloat>(float: F) -> ExtendedFloat80 {
return extended_float(... | 1 | 20 | 30 |
5140eacebce834e6bcf6af04d0e0112ce1a65ed4 | Alex Huszagh | 2021-09-03T13:44:35 | Fix for #66. | diff --git a/lexical-parse-float/tests/api_tests.rs b/lexical-parse-float/tests/api_tests.rs
index 06f5c64..a69edfd 100644
--- a/lexical-parse-float/tests/api_tests.rs
+++ b/lexical-parse-float/tests/api_tests.rs
@@ -1212,6 +1212,22 @@ fn base_prefix_and_suffix_test() {
assert!(f64::from_lexical_with_options::<FOR... | 4 | 31 | 1 |
1ca2d4b2bd292870b81b44ce85eab1dd1dbecfbd | Alex Huszagh | 2021-09-03T05:05:16 | Update bug for documentation. | diff --git a/lexical-util/src/constants.rs b/lexical-util/src/constants.rs
index 5d54d65..02a23db 100644
--- a/lexical-util/src/constants.rs
+++ b/lexical-util/src/constants.rs
@@ -18,7 +18,7 @@ pub trait FormattedSize {
/// buffer than the one provided. An upper limit on the buffer size can
/// then be deter... | 1 | 2 | 2 |
8155e76eac459de24f99baa4e8182dff3e439d54 | Alex Huszagh | 2021-09-03T04:45:59 | Minor bug fix for feature-gated f16 unittests. | diff --git a/lexical-parse-float/tests/api_tests.rs b/lexical-parse-float/tests/api_tests.rs
index 3f25cfc..06f5c64 100644
--- a/lexical-parse-float/tests/api_tests.rs
+++ b/lexical-parse-float/tests/api_tests.rs
@@ -1299,6 +1299,7 @@ quickcheck! {
actual.map_or(false, |y| expected.map_or(false, |x| float_equa... | 1 | 2 | 0 |
593c282d91cd5f12cde1f08bb5c0828604d9d0ac | Alex Huszagh | 2021-09-03T04:42:40 | Add unittests for half-precision types. | diff --git a/lexical-parse-float/tests/api_tests.rs b/lexical-parse-float/tests/api_tests.rs
index a3a7fbf..3f25cfc 100644
--- a/lexical-parse-float/tests/api_tests.rs
+++ b/lexical-parse-float/tests/api_tests.rs
@@ -1,7 +1,11 @@
#[cfg(feature = "format")]
use core::num;
use lexical_parse_float::{FromLexical, FromLe... | 4 | 104 | 0 |
f0d582d18ba34a6c39d6960656cbd7ff36bf9331 | Alex Huszagh | 2021-09-03T04:29:51 | Add documentation and tests for fast-path only case. | diff --git a/lexical-parse-float/src/lib.rs b/lexical-parse-float/src/lib.rs
index f339a69..01038c5 100644
--- a/lexical-parse-float/src/lib.rs
+++ b/lexical-parse-float/src/lib.rs
@@ -52,6 +52,23 @@
//! conversions, please look at [lexical-core](https://crates.io/crates/lexical-core)
//! instead.
//!
+//! # Machine... | 2 | 51 | 0 |
fc658c68fcfaa27583fc7cb8f5b8ef3f0bed1a2d | Alex Huszagh | 2021-09-03T04:18:45 | Closes #40. | diff --git a/lexical-parse-float/src/number.rs b/lexical-parse-float/src/number.rs
index 5759d20..519e4c3 100644
--- a/lexical-parse-float/src/number.rs
+++ b/lexical-parse-float/src/number.rs
@@ -97,4 +97,39 @@ impl<'a> Number<'a> {
None
}
}
+
+ /// Force a fast-path algorithm, even when ... | 2 | 119 | 3 |
4a965c0d7477e3118466fe3030e48a34dd224824 | Alex Huszagh | 2021-09-03T02:57:52 | Added initial implementation of parse-float for f16. | diff --git a/lexical-parse-float/src/api.rs b/lexical-parse-float/src/api.rs
index c00a082..b766b7b 100644
--- a/lexical-parse-float/src/api.rs
+++ b/lexical-parse-float/src/api.rs
@@ -4,7 +4,11 @@
use crate::options::Options;
use crate::parse::ParseFloat;
+#[cfg(feature = "f16")]
+use lexical_util::bf16::bf16;
us... | 6 | 136 | 236 |
3a1f3382e15a6ae25fda1f9b27706910160d6908 | Alex Huszagh | 2021-09-03T02:47:26 | Initial implementation for write-float with f16 and bf16. | diff --git a/lexical-core/Cargo.toml b/lexical-core/Cargo.toml
index 260d6f4..8f5b3af 100644
--- a/lexical-core/Cargo.toml
+++ b/lexical-core/Cargo.toml
@@ -117,6 +117,12 @@ nightly = [
"lexical-parse-integer/nightly",
"lexical-parse-float/nightly"
]
+# Enable support for 16-bit floats.
+f16 = [
+ "lexica... | 19 | 1,007 | 53 |
446e11bd05397fcd19077fe61790fbe41060f74d | Alex Huszagh | 2021-09-02T19:27:48 | Bug fixes for write-float with rounding.
- Fixed issue in `round_up` with non-contiguous digits.
- Added more unittests to test edge-cases of writing and parsing floats
with custom radixes, including with formatting.
An issue before was if we had a string like 'A.9F', where we want to
truncate to 2 digits, it would... | diff --git a/lexical-parse-float/Cargo.toml b/lexical-parse-float/Cargo.toml
index af3a8d5..783dadb 100644
--- a/lexical-parse-float/Cargo.toml
+++ b/lexical-parse-float/Cargo.toml
@@ -32,6 +32,11 @@ features = []
static_assertions = "1"
[dev-dependencies]
+# FIXME: Replace back to "1.0.4" once the PR is merged.
+#... | 4 | 668 | 16 |
5fd10d6551a16b45369005e1b92e1e3d30098741 | Alex Huszagh | 2021-09-02T17:04:20 | Increment versions for release. | diff --git a/lexical-core/Cargo.toml b/lexical-core/Cargo.toml
index c5ed480..260d6f4 100644
--- a/lexical-core/Cargo.toml
+++ b/lexical-core/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical-core"
readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-lexical"
-version = "0.1.0"
... | 7 | 19 | 19 |
91770b77a4a28db9142ef04d046d588f89120e11 | Alex Huszagh | 2021-09-01T02:38:44 | Bug fixes for Bellerophon algorithm.
- Failed to check cases with a 0 manissa.
- Failed to check bounds on exponent before using a narrowing cast on
the exponent.
Both of these fix the conformance test issues with the compact
algorithm. | diff --git a/lexical-parse-float/src/bellerophon.rs b/lexical-parse-float/src/bellerophon.rs
index 15f4f86..a59463e 100644
--- a/lexical-parse-float/src/bellerophon.rs
+++ b/lexical-parse-float/src/bellerophon.rs
@@ -50,9 +50,19 @@ pub fn bellerophon<F: RawFloat, const FORMAT: u128>(num: &Number, lossy: bool) -
... | 2 | 18 | 1 |
25e9d216a125e4b36941bdb6b0060e77f721e962 | Alex Huszagh | 2021-08-31T23:25:47 | Bug fix for lints with LLVM assembly. | diff --git a/lexical-benchmark/parse-float/black_box.rs b/lexical-benchmark/parse-float/black_box.rs
index 85be656..4fe7382 100644
--- a/lexical-benchmark/parse-float/black_box.rs
+++ b/lexical-benchmark/parse-float/black_box.rs
@@ -1,3 +1,5 @@
+// Allow deprecated due to deprecation of LLVM assembly.
+#[allow(deprecat... | 1 | 2 | 0 |
d6f732237840917aba2f23db87f32ffbb1f1fa38 | Alex Huszagh | 2021-08-31T17:08:51 | Bug fixes for computer_nearest_shorter.
- Added comprehensive float writing unittests.
- Added bug fixes for an incorrect endpoint check. | diff --git a/lexical-write-float/etc/correctness/Cargo.toml b/lexical-write-float/etc/correctness/Cargo.toml
new file mode 100644
index 0000000..21c0fd7
--- /dev/null
+++ b/lexical-write-float/etc/correctness/Cargo.toml
@@ -0,0 +1,38 @@
+[package]
+name = "lexical-write-float-correctness"
+version = "0.0.1"
+authors = ... | 6 | 208 | 1 |
6faa57a2ec3d21971fcf736f2272d7f510d725c7 | Alex Huszagh | 2021-08-31T04:49:32 | Added bug fixes for write float. | diff --git a/lexical-write-float/src/algorithm.rs b/lexical-write-float/src/algorithm.rs
index 758ca45..843fd78 100644
--- a/lexical-write-float/src/algorithm.rs
+++ b/lexical-write-float/src/algorithm.rs
@@ -1170,7 +1170,7 @@ macro_rules! divisible_by_pow5 {
let max_quotients = &Self::$table.max_quotients;
... | 2 | 6 | 1 |
f8c5113b8c8c98031bf20f8ea0059541036a42a0 | Alex Huszagh | 2021-08-31T01:25:30 | Added minor bug fixes. | diff --git a/lexical-util/tests/feature_format_tests.rs b/lexical-util/tests/feature_format_tests.rs
index ad64599..cd23ef0 100644
--- a/lexical-util/tests/feature_format_tests.rs
+++ b/lexical-util/tests/feature_format_tests.rs
@@ -25,7 +25,9 @@ fn ignore_test() {
assert_eq!(fmt.no_float_leading_zeros(), false);
... | 2 | 13 | 0 |
e062276cbf3c8fead353a6f67213bad5c772afe4 | Alex Huszagh | 2021-08-30T03:13:44 | Support for base prefixes and suffixes. | diff --git a/lexical-parse-float/tests/api_tests.rs b/lexical-parse-float/tests/api_tests.rs
index 07daa44..8b4d5d8 100644
--- a/lexical-parse-float/tests/api_tests.rs
+++ b/lexical-parse-float/tests/api_tests.rs
@@ -1108,6 +1108,70 @@ fn f64_json_no_leading_zero() {
assert!(f64::from_lexical_with_options::<FORMAT... | 3 | 145 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.