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 |
|---|---|---|---|---|---|---|---|
ccb3fab6fdfbf4d0a6fad3ce4087dde734aa036c | Alex Huszagh | 2018-12-16T06:19:47 | Fixed a minor integer overflow bug for signed integer parsing. | diff --git a/lexical-core/src/atoi.rs b/lexical-core/src/atoi.rs
index 9c30ccb..b4ab562 100644
--- a/lexical-core/src/atoi.rs
+++ b/lexical-core/src/atoi.rs
@@ -284,7 +284,10 @@ pub(crate) unsafe fn signed<T, Cb>(radix: u32, first: *const u8, last: *const u8
let mut state = ParseState::new(first);
let... | 1 | 12 | 1 |
2bce41b880519042a62868d494c8751201bd3a08 | Alex Huszagh | 2018-12-15T19:39:04 | Updated category slugs. | diff --git a/Cargo.toml b/Cargo.toml
index ab7073c..fea556b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
authors = ["Alex Huszagh <ahuszagh@gmail.com>"]
autobenches = false
-categories = ["parsing", "encoding", "no_std"]
+categories = ["parsing", "encoding", "no-std"]
description = "Lexical, t... | 2 | 2 | 2 |
17f2638b634e8404344810115f595e84d96d6366 | Alex Huszagh | 2018-12-11T18:16:24 | Fixed a regression with a string on nightly. | diff --git a/src/atof/algorithm/precise.rs b/src/atof/algorithm/precise.rs
index 67ca7af..2cbac76 100644
--- a/src/atof/algorithm/precise.rs
+++ b/src/atof/algorithm/precise.rs
@@ -777,6 +777,7 @@ pub(crate) unsafe extern "C" fn atod_lossy(base: u32, first: *const u8, last: *c
#[cfg(test)]
mod tests {
+ use lib:... | 1 | 1 | 0 |
32fae99df0279fca2492d0b6a35928e9fdf11b22 | Alex Huszagh | 2018-12-11T18:11:08 | Bug fix for a regression in long_mul, accidentally removed an index offset. | diff --git a/src/atof/algorithm/math.rs b/src/atof/algorithm/math.rs
index 098b22d..27ac777 100644
--- a/src/atof/algorithm/math.rs
+++ b/src/atof/algorithm/math.rs
@@ -984,7 +984,7 @@ fn long_mul<T>(x: &[u32], y: &[u32])
// Handle the iterative cases.
for (i, yi) in y[1..].iter().enumerate() {
... | 1 | 1 | 1 |
fd9cc52d105159ccd4eb6cb0e410481985e06e0c | Alex Huszagh | 2018-12-10T05:11:05 | Finished the fast irem algorithm for digit generation. | diff --git a/src/atof/algorithm/math.rs b/src/atof/algorithm/math.rs
index 41b8015..bf67628 100644
--- a/src/atof/algorithm/math.rs
+++ b/src/atof/algorithm/math.rs
@@ -330,7 +330,7 @@ pub fn shr<T>(x: &[u32], n: usize)
///
/// Assumes `n < 32`, IE, internally shifting bits.
#[inline]
-pub fn ishl_bits<T>(x: &mut T,... | 1 | 311 | 130 |
c289b754fed9afb6cc4a31d7051f1ab53b0ae31d | Alex Huszagh | 2018-12-09T22:18:45 | Finished the division algorithm, time to implement the fast division algorithm. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index c93a701..033a3e0 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -389,41 +389,6 @@ impl Bigfloat {
Self::min_value()
}
- /// Create new Bigfloat from u32.
- #[inline]
- pub fn ... | 2 | 197 | 144 |
d4d2d229fa0c3ec4e4be2e28a69792b01b30920c | Alex Huszagh | 2018-12-09T18:36:32 | Added Knuth Algorithm D for fast divisions. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 2a0e4e4..c93a701 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -366,7 +366,7 @@ unsafe fn parse_float(base: u32, first: *const u8, last: *const u8)
/// both the exponentiation and multiplication. Th... | 2 | 448 | 256 |
c31bf0ad844ba71a1237c8477be6783d412d8f4f | Alex Huszagh | 2018-12-09T15:33:59 | Added Karatsuba multiplication for big number operations. | diff --git a/Cargo.toml b/Cargo.toml
index 952c4f2..cb5c7f2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -22,7 +22,7 @@ travis-ci = { repository = "Alexhuszagh/rust-lexical" }
cfg-if = "0.1"
static_assertions = "0.2.5"
# Use small-vector optimization for Bigfloat class.
-# TODO(ahuszagh) Remove...
+# TODO(ahuszagh) M... | 5 | 140 | 40 |
d57743450272fe0ce3bf9d147d2917c858d625a8 | Alex Huszagh | 2018-12-08T18:11:45 | Renamed Bignum to SmallOps, so we can do LargeOps later. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index b79c8ac..2bb560a 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -14,7 +14,7 @@ use float::rounding::*;
use lib::mem;
use util::*;
use super::exponent::*;
-use super::math::Bignum;
+use super::math:... | 2 | 58 | 51 |
0201f52cf4cea0bf7a92b25be5d13166dd66e4d3 | Alex Huszagh | 2018-12-08T18:00:11 | Added a remove_many for efficient removals from vectors over a range, and added shl and shr implementations for big integers. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index abc082f..b79c8ac 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -8,7 +8,7 @@
use smallvec;
use atoi;
-use float::{ExtendedFloat80, FloatRounding, Mantissa};
+use float::{ExtendedFloat80, FloatRoun... | 3 | 303 | 25 |
ceffe1d45fb46bc89e161b8c76066c84cdcf55cb | Alex Huszagh | 2018-12-08T03:51:39 | Moved pad_zeros to the math building block module and simplifed the bigfloat implementation. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index ef13365..abc082f 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -470,42 +470,22 @@ impl Bigfloat {
// DIVISION
- /// Pad ints for division. Called internally during `div_pow*_assign`.
- ... | 3 | 60 | 67 |
a127c6f8ca7773902d5d5ef3609ef82683a79871 | Alex Huszagh | 2018-12-07T21:10:15 | Implemented the fast path for bigcomp. | diff --git a/src/atof/algorithm/bigcomp.rs b/src/atof/algorithm/bigcomp.rs
index 7d34ff6..94bb80e 100644
--- a/src/atof/algorithm/bigcomp.rs
+++ b/src/atof/algorithm/bigcomp.rs
@@ -10,7 +10,9 @@
#![allow(unused)] // TODO(ahuszagh) Remove later
+use lib::{cmp, iter};
use float::*;
+use table::*;
use util::*... | 3 | 144 | 20 |
d0e7e58776a7173359c2bd38d0c5d57760f4515b | Alex Huszagh | 2018-12-05T23:40:55 | Added BITS field to Integer and Float. | diff --git a/src/atof/algorithm/bigcomp.rs b/src/atof/algorithm/bigcomp.rs
index c0d2b6b..7531924 100644
--- a/src/atof/algorithm/bigcomp.rs
+++ b/src/atof/algorithm/bigcomp.rs
@@ -11,13 +11,42 @@
#![allow(unused)] // TODO(ahuszagh) Remove later
use util::*;
+use super::exponent::*;
-/// Calculate `b` from ... | 8 | 149 | 26 |
41eb14d6099716d99f7e4a9dd94f9785e694bb12 | Alex Huszagh | 2018-12-05T22:18:39 | Added rounding modes for TowardInfinity and TowardZero, and added high-level APIs to call the custom rounding schemes. | diff --git a/src/atof/algorithm/bigcomp.rs b/src/atof/algorithm/bigcomp.rs
new file mode 100644
index 0000000..c0d2b6b
--- /dev/null
+++ b/src/atof/algorithm/bigcomp.rs
@@ -0,0 +1,42 @@
+//! An implementation of bigcomp for Rust.
+//!
+//! Compares the known string to theoretical digits generated on the
+//! fly for `b... | 9 | 426 | 149 |
c42de23cfa5a16a30d56c37f6bc0390546045b29 | Alex Huszagh | 2018-12-05T05:58:21 | Fixed a bug where the is_truncated status stays for dtoa and the trunc position is properly set. | diff --git a/src/atof/algorithm/exponent.rs b/src/atof/algorithm/exponent.rs
index 62f2d15..c1e196f 100644
--- a/src/atof/algorithm/exponent.rs
+++ b/src/atof/algorithm/exponent.rs
@@ -1,6 +1,6 @@
//! Algorithm to parse an exponent from a float string.
-use lib::ptr;
+use lib::{mem, ptr};
use atoi;
use util::*;
... | 2 | 25 | 19 |
3f041e3258f7c18b5e2533d8218ae9f0eeb75997 | Alex Huszagh | 2018-12-05T05:52:28 | Removed the range API and simplified some of the ParseState API. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 90667a6..0b79101 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -414,21 +414,19 @@ fn padded_bits(i: u32, n:i32) -> u32 {
/// * `base` - Radix for the number encoding.
/// * `small_powers` ... | 8 | 168 | 369 |
5fd5b3ee6e2b644d6a6a5e1c9fa5e8f641cd6536 | Alex Huszagh | 2018-11-27T21:14:00 | Bug fix for warnings and dependency graphs in Cargo. | diff --git a/Cargo.toml b/Cargo.toml
index 23e1a85..ed42d27 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical"
readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-lexical"
-version = "1.6.6"
+version = "1.6.7"
exclude = [
"data/*",
"benc... | 2 | 4 | 3 |
c68cdfe6e27cf46831860631acac2a0609610dfd | Alex Huszagh | 2018-11-27T18:47:34 | Bug fix with the stress test configuration options. | diff --git a/tests/stress.rs b/tests/stress.rs
index f52fc7a..8f454cb 100644
--- a/tests/stress.rs
+++ b/tests/stress.rs
@@ -111,9 +111,10 @@ fn stress_test<T: 'static + Debug + PartialEq + lexical::FromBytes>(test: &Stres
}
}
-// Disable the stress tests when using the precise algorithm, since the
-// imprecis... | 1 | 4 | 3 |
6a463c69ab91107f556641d8fb29821a04314752 | Alex Huszagh | 2018-11-27T15:39:42 | Removed debugging println statement. | diff --git a/Cargo.toml b/Cargo.toml
index 532efa5..dbf3a0a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical"
readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-lexical"
-version = "1.6.3"
+version = "1.6.4"
exclude = [
"data/*",
"benc... | 2 | 1 | 2 |
467be9d85175ec3db49c3532631d38b3b03377a9 | Alex Huszagh | 2018-11-26T23:35:19 | Added stress tests from the testbase report. | diff --git a/src/atof/algorithm/precise.rs b/src/atof/algorithm/precise.rs
index ef80cc8..c9148bb 100644
--- a/src/atof/algorithm/precise.rs
+++ b/src/atof/algorithm/precise.rs
@@ -990,6 +990,19 @@ mod tests {
// Adapted from failures in strtod.
check_atod(10, "2.2250738585072014e-308", (2.225... | 2 | 130 | 0 |
805e7255a4fffaec0c33fbe455ceaf6a068cff4a | Alex Huszagh | 2018-11-26T22:40:36 | Added benchmarks for more malicious data. | diff --git a/benches/atof_malicious.rs b/benches/atof_malicious.rs
index d1051fc..0ee846f 100644
--- a/benches/atof_malicious.rs
+++ b/benches/atof_malicious.rs
@@ -26,9 +26,9 @@ fn atof_malicious_f32_parse(bench: &mut Bencher) {
// F64
-// Fails with the following, valid item:
-// "2.470328229206232720882843... | 1 | 12 | 4 |
cf71fe8074793f0504192bc962734136bee193ec | Alex Huszagh | 2018-11-26T19:45:12 | Finished a rounding bug causing underflow with denormal floats. | diff --git a/data/test-strtod/main.rs b/data/test-strtod/main.rs
index 2334591..c5af2f5 100644
--- a/data/test-strtod/main.rs
+++ b/data/test-strtod/main.rs
@@ -77,7 +77,13 @@ fn run_test(string: &str, hex: &str) {
let lower = string.to_lowercase();
if lower == "nan" || !lower.contains("nan") {
let f... | 4 | 47 | 5 |
55daa267a078d421879968da6fa692bd3f91436f | Alex Huszagh | 2018-11-26T19:07:05 | Fixed integer overflow bug with denormal exponents in error_is_accurate. | diff --git a/data/test-strtod/main.rs b/data/test-strtod/main.rs
index 0f480da..2334591 100644
--- a/data/test-strtod/main.rs
+++ b/data/test-strtod/main.rs
@@ -73,9 +73,12 @@ pub fn data_dir() -> PathBuf {
}
fn run_test(string: &str, hex: &str) {
- // TODO(ahuszagh) Need to accept 'e' or 'E'.
- let float: f6... | 6 | 62 | 35 |
c4cc6ef892d911c7bef1d30a036f7a8193f54357 | Alex Huszagh | 2018-11-26T18:03:09 | Added more unittests for case-insensitive parsing. | diff --git a/src/util/config.rs b/src/util/config.rs
index d88064b..f263cbe 100644
--- a/src/util/config.rs
+++ b/src/util/config.rs
@@ -80,11 +80,13 @@ mod tests {
#[ignore]
fn special_bytes_test() {
// Test serializing and deserializing special strings.
- // TODO(ahuszagh) Need case-insensit... | 1 | 6 | 7 |
736a390c003a5d1231e3d152d07bfc073aeeb7e0 | Alex Huszagh | 2018-11-26T17:59:52 | Made nan, inf, and exponent recognition case-insensitive, as per various float-parsing recommendations. | diff --git a/src/atof/algorithm/exponent.rs b/src/atof/algorithm/exponent.rs
index a70f950..fd96237 100644
--- a/src/atof/algorithm/exponent.rs
+++ b/src/atof/algorithm/exponent.rs
@@ -18,7 +18,7 @@ pub(super) unsafe extern "C" fn parse_exponent(base: u32, first: *const u8, last
{
let mut p = first;
let dist... | 4 | 233 | 16 |
b83df0ee601cecd096abe43130c9bd7fd12449e9 | Alex Huszagh | 2018-11-25T19:40:54 | Reduced code bloat, removed some precomputed arrays in low-performance locations that use efficient bit-masks. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index ec02815..d44d73d 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -1860,8 +1860,8 @@ impl Bigfloat {
// Create our wrapper for round_nearest_tie_even.
// If there are truncated bits, a... | 7 | 163 | 288 |
c83f45cfc7f11aff9993aed0e9609d765d02a933 | Alex Huszagh | 2018-11-25T18:01:00 | Robust halfway representation tests to ensure rounding works even for arbitrarily-long input strings for the atof functionality. | diff --git a/Cargo.toml b/Cargo.toml
index 9016129..e2fb818 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical"
readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-lexical"
-version = "1.6.2"
+version = "1.6.3"
exclude = [
"benches/*",
]
diff... | 3 | 102 | 2 |
10e0b4c3e5b6417d00a0f889102cf1978dcd2a25 | Alex Huszagh | 2018-11-25T06:56:33 | Bug fix for the number of digitsparsed and integer overflow in the correct atof parser. | diff --git a/Cargo.toml b/Cargo.toml
index 0739335..9016129 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical"
readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-lexical"
-version = "1.6.1"
+version = "1.6.2"
exclude = [
"benches/*",
]
diff... | 2 | 5 | 2 |
8b0fc7f4bd7bc062ac44334ecf7be3615b959179 | Alex Huszagh | 2018-11-25T05:13:24 | Publicly expose traits to fix issue #1. | diff --git a/src/lib.rs b/src/lib.rs
index 5eb8688..903b398 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -111,10 +111,12 @@ pub use util::{INFINITY_STRING, NAN_STRING};
// Re-export the Error and ErrorKind globally.
pub use error::{Error, ErrorKind};
+// Publicly expose traits so they may be used for generic program... | 2 | 6 | 3 |
824895bc7f92404f10803a6d3ad995b7814dd08e | Alex Huszagh | 2018-11-25T04:33:51 | Publicly exposed Bigfloat for performance benchmarking. | diff --git a/Cargo.toml b/Cargo.toml
index f01694f..0739335 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical"
readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-lexical"
-version = "1.6.0"
+version = "1.6.1"
exclude = [
"benches/*",
]
@@ -... | 6 | 53 | 4 |
a3d4873b71817cdbb0a9662ef06d9badd3b9c3ca | Alex Huszagh | 2018-11-25T01:00:59 | Bug fix for quickcheck without the precise algorithm. | diff --git a/src/ftoa/api.rs b/src/ftoa/api.rs
index 4d74480..39f87de 100644
--- a/src/ftoa/api.rs
+++ b/src/ftoa/api.rs
@@ -331,6 +331,7 @@ mod tests {
}
}
+ #[cfg(all(feature = "table", not(feature = "imprecise")))]
quickcheck! {
fn f32_quickcheck(f: f32) -> bool {
f == a... | 1 | 1 | 0 |
3cd33c0ace0dac454c2e70df001fc300b272cbc1 | Alex Huszagh | 2018-11-24T20:19:31 | Added bigfloat implementations and unittests. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 900653e..e88145c 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -13,6 +13,7 @@ use float::convert::as_float;
use float::rounding::*;
use lib::{mem, slice};
use util::*;
+use super::exponent::*;
... | 3 | 284 | 86 |
d4a0be7903c836e8bbcbcf4e87c33e2e8102edd5 | Alex Huszagh | 2018-11-24T15:19:59 | Finished the mantissa parsing algorithm using small powers. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index a7ede23..900653e 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -7,6 +7,7 @@
#![allow(dead_code)]
use smallvec;
+use atoi;
use float::{ExtendedFloat80, FloatRounding, Mantissa};
use float::conve... | 2 | 42 | 8 |
22482fcbebdd83d3ae3709ec063006944744aa90 | Alex Huszagh | 2018-11-23T21:04:38 | Added static assertions for various data inside the binary. | diff --git a/Cargo.toml b/Cargo.toml
index 9df52e6..82d0b61 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,6 +19,7 @@ travis-ci = { repository = "Alexhuszagh/rust-lexical" }
[dependencies]
cfg-if = "0.1"
+static_assertions = "0.2.5"
# Use small-vector optimization for Bigfloat class.
smallvec = "0.6"
# Optimize... | 5 | 259 | 42 |
d497a9e230e3e7b4b3c954f2a9939654dcf491d4 | Alex Huszagh | 2018-11-23T16:18:39 | Added slice wrappers for range utilities. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 333a8b6..c357cc2 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -221,6 +221,21 @@ fn padded_bits(i: u32, n:i32) -> u32 {
v as u32
}
+// PARSE MANTISSA
+
+/// Parse the mantissa into a bigfloat... | 6 | 189 | 58 |
df9d211bbda210cf8f47715291923582acc83845 | Alex Huszagh | 2018-11-23T14:37:11 | Added more wrappers for code, more unittests, and finished all but the parsing interface. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 6704956..333a8b6 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -1,11 +1,11 @@
//! Arbitrary-precision decimal to parse a floating-point number.
-// TODO(ahuszagh) Remove this arbitrary warning, we'r... | 1 | 13 | 10 |
dec1f2fedfb740d4e589cf7a6ecb32d84bbaba23 | Alex Huszagh | 2018-11-23T14:08:00 | Finished the as_float logic and added wrap_assign wrappers to simplify codegen. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index be76ac3..6704956 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -223,28 +223,45 @@ fn padded_bits(i: u32, n:i32) -> u32 {
v as u32
}
+// ASSIGN
+
+/// Wrap operation in terms of OpAssign call.... | 2 | 277 | 146 |
bb3b3497007d7ae7f440b3c5c34687a11f684a25 | Alex Huszagh | 2018-11-23T05:00:55 | Added preliminary testing for the as_float functions. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index b00d23d..be76ac3 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -423,10 +423,12 @@ impl Bigfloat {
/// Create new Bigfloat from u32.
#[inline]
pub fn from_u32(x: u32) -> Bigfloat {
- ... | 1 | 89 | 7 |
3febf33cf5045a11c27a30c798dc0f78d3d1d562 | Alex Huszagh | 2018-11-23T04:29:12 | Added first unittest for as_float, generally working. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 930acb8..b00d23d 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -1512,23 +1512,27 @@ impl Bigfloat {
}
/// Calculate the real exponent for the float.
- /// Same as `self.exp + (Self::BI... | 2 | 29 | 6 |
8afa945fd3d442155261d9c83b85fd296bba8dd9 | Alex Huszagh | 2018-11-23T04:24:10 | Exported a semi-functional version of as_float, no unittests yet. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 26c9f5c..930acb8 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -7,7 +7,9 @@
// Only use static checks inside of functions.
use smallvec;
-use float::Mantissa;
+use float::{ExtendedFloat80, FloatR... | 5 | 268 | 89 |
90d9180445b29ee56b8d365cff4d727ec9bf0225 | Alex Huszagh | 2018-11-23T01:55:54 | Restored unittests for padded_bits, all I need for the correct parser is the actual parsing logic and the conversion to f32 (later is easy). | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 269a996..26c9f5c 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -1954,37 +1954,36 @@ mod tests {
}
// Check compared to known values.
- // TODO(ahuszagh) Restore
-// ... | 1 | 30 | 31 |
887ce8bf41f2eb5f884ae8213f3d39cd32e33ea8 | Alex Huszagh | 2018-11-23T01:31:56 | Finished division and added unittests for the accurate division tests. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 0a26b2d..269a996 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -3,6 +3,9 @@
// in rapid development, so allow it for now.
#![allow(dead_code)]
+// TODO(ahuszagh) Move all the bounds checks outsid... | 1 | 241 | 205 |
d6c9481e0f7d0bbc4d834ada5596bb18ef0d02e4 | Alex Huszagh | 2018-11-22T18:14:38 | Fixed the padded_bits. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 85ea8ca..0a26b2d 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -137,11 +137,40 @@ fn div_small_assign<Wide, Narrow>(x: &mut Narrow, y: Narrow, rem: Narrow)
// PAD DIVISION
+/// String for memory... | 1 | 153 | 122 |
141d8acb8cb2be8bcfb7308d6a65e3c24d7dba21 | Alex Huszagh | 2018-11-22T17:24:05 | Adding tests for division. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 588adca..85ea8ca 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -1,11 +1,11 @@
//! Arbitrary-precision decimal to parse a floating-point number.
// TODO(ahuszagh) Remove this arbitrary warning, we'r... | 6 | 570 | 109 |
902b388b9dc5512b26901944e2a47caaee640965 | Alex Huszagh | 2018-11-22T05:10:32 | Finished pad_division. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index d87dd78..588adca 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -1636,28 +1636,40 @@ mod tests {
// DIVISION
- // TODO(ahuszagh) Needs to pad to a number of bits.
#[test]
fn pad_... | 1 | 32 | 20 |
5a35b3ae197671698863941a23bcad096a50a7a9 | Alex Huszagh | 2018-11-22T05:06:43 | Simplified the usage of as_cast. | diff --git a/src/table.rs b/src/table.rs
index 4dda068..724c0d5 100644
--- a/src/table.rs
+++ b/src/table.rs
@@ -160,9 +160,8 @@ const F32_EXACT_EXPONENT_LIMITS: [(i32, i32); 35] = [
#[cfg(any(test, not(feature = "imprecise")))]
impl ExactExponent for f32 {
fn exponent_limit<T: Integer>(base: T) ->(i32, i32) {
-... | 2 | 12 | 18 |
9a022d6d958bf47f3e03eb40c9c57a73bfab5a0b | Alex Huszagh | 2018-11-22T05:00:43 | Bug fixes for when literal as could lead to improper truncation. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 740806c..d87dd78 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -308,7 +308,7 @@ impl Bigfloat {
debug_assert!(!self.back().is_zero(), "Bigfloat::trailing_zeros() data is not normalized.");
... | 15 | 309 | 30 |
2989e10de58e57361915ecb9bc5ce183d59bf7f2 | Alex Huszagh | 2018-11-22T04:13:51 | Added TryCast, which fails to cast if the conversion is lossy, and added unwrap_or helpers to facilitate lossy conversion defaults. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 6a1bb2e..740806c 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -43,6 +43,14 @@ const SMALL_POWERS_BASE29: [u32; 7] = [1, 29, 841, 24389, 707281, 20511149, 5948
/// Small powers (u32) for base31 oper... | 7 | 839 | 33 |
9c02a46230910f4d10c1bff84c08b4ca19ab4df7 | Alex Huszagh | 2018-11-22T01:10:40 | Implemented try_cast to allow safe type conversions. | diff --git a/src/atof/algorithm/precise.rs b/src/atof/algorithm/precise.rs
index 44dc98f..446329c 100644
--- a/src/atof/algorithm/precise.rs
+++ b/src/atof/algorithm/precise.rs
@@ -28,6 +28,7 @@ use super::exponent::parse_exponent;
/// Safely convert the number of bits truncated to an exponent.
// TODO(ahuszagh) Ne... | 2 | 176 | 6 |
056cc1d12acbd02f9174b5092c0dffd16977c8d4 | Alex Huszagh | 2018-11-21T23:56:59 | Change 'as_' to 'as_cast'. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 12db899..6a1bb2e 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -81,8 +81,8 @@ fn mul_small<Wide, Narrow>(x: Narrow, y: Narrow, carry: Narrow)
// the following is always true:
// `Wide::max_... | 16 | 362 | 192 |
151986124abcee4bf322ef5e8b8eeb15770b9cb4 | Alex Huszagh | 2018-11-21T20:57:19 | Re-wrote multiplication and division to use implied methods, need to finish the division implementation. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index f1b6c81..12db899 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -8,6 +8,41 @@ use float::Mantissa;
use lib::{mem, iter, slice};
use util::*;
+// CONSTANTS
+
+/// Small powers (u32) for base3 opera... | 1 | 559 | 273 |
b96f3b4a333d6204a73b1804592ffaccc2320b36 | Alex Huszagh | 2018-11-21T19:51:51 | Added unittests for division. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 3a2b224..f1b6c81 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -5,7 +5,7 @@
use smallvec;
use float::Mantissa;
-use lib::{mem, slice};
+use lib::{mem, iter, slice};
use util::*;
// ADD
@@ -34... | 1 | 373 | 70 |
754066f2d548e553a11cab8c9fc2ff41a3792a6c | Alex Huszagh | 2018-11-21T00:44:18 | Added small powers to simplify multiplication. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index e0296ec..b600220 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -10,8 +10,6 @@ use util::*;
// ADD
-// TODO(ahuszagh) Add the carry component?????
-
/// Add two small integers (and return if ove... | 1 | 117 | 35 |
119fdf2ed9399b0423aa89d896de3c364e34459c | Alex Huszagh | 2018-11-21T00:21:15 | Added mul_small implementation. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 54133c3..e0296ec 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -10,15 +10,21 @@ use util::*;
// ADD
+// TODO(ahuszagh) Add the carry component?????
+
/// Add two small integers (and return if o... | 1 | 264 | 218 |
a521d35cc77b6bfaa1128a21eef30f9730e31cdc | Alex Huszagh | 2018-11-20T21:55:24 | Modified bigfloat to use smallvec. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 4b12641..54133c3 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -3,6 +3,7 @@
// in rapid development, so allow it for now.
#![allow(unused)]
+use smallvec;
use float::Mantissa;
use lib::{mem, sl... | 3 | 180 | 165 |
f9371f64ce36ba1597523e24184ee0c9425601f0 | Alex Huszagh | 2018-11-19T22:28:54 | Added skeletons for multiplying by powers of n. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 90bc443..1e23c1f 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -53,6 +53,11 @@ fn add_one_assign<T: Integer>(x: &mut T) -> bool {
// FROM BYTES
+/// Wrap operation using an assign internally.
+m... | 1 | 184 | 2 |
b243c2ce467989c3962513e1cb86e066b635fe7e | Alex Huszagh | 2018-11-19T22:00:23 | Finished the bigfloat add_large_assign implementation. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 875b12f..90bc443 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -3,11 +3,82 @@
// in rapid development, so allow it for now.
#![allow(unused)]
+use float::Mantissa;
+use lib::{mem, slice};
use ut... | 2 | 446 | 54 |
f2a49215c910628733ea29f2db78a1bb36c86099 | Alex Huszagh | 2018-11-16T17:18:30 | Added version for big float. | diff --git a/src/atof/algorithm/bigfloat.rs b/src/atof/algorithm/bigfloat.rs
index 979d9ba..875b12f 100644
--- a/src/atof/algorithm/bigfloat.rs
+++ b/src/atof/algorithm/bigfloat.rs
@@ -1,16 +1,130 @@
//! Arbitrary-precision decimal to parse a floating-point number.
+// TODO(ahuszagh) Remove this arbitrary warning, we'... | 3 | 124 | 7 |
6b22630076ba0497136076ee31d852756646bd66 | Alex Huszagh | 2018-11-16T17:02:03 | Renamed some features, added parse_lossy*. | diff --git a/Cargo.toml b/Cargo.toml
index b7f09c1..784e530 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -38,10 +38,10 @@ ryu = "0.2"
default = ["ryu", "std", "table"]
alloc = ["wee_alloc"]
nightly = ["alloc"]
-# Use the completely correct atof functionality (unsupported as of now).
-correct = []
# Use the optimized... | 12 | 356 | 53 |
2d37739d2a7c6d113952846d23f690fea64082bf | Alex Huszagh | 2018-11-15T19:54:36 | Added unittests for correct. | diff --git a/src/atof/algorithm/correct.rs b/src/atof/algorithm/correct.rs
index 7672a21..ab8534f 100644
--- a/src/atof/algorithm/correct.rs
+++ b/src/atof/algorithm/correct.rs
@@ -466,7 +466,6 @@ unsafe extern "C" fn to_native<F>(base: u32, first: *const u8, last: *const u8)
/// Parse 32-bit float from string.
#[i... | 1 | 45 | 6 |
a00e9ba157f30f67f1468e4dfdc0b44ded547447 | Alex Huszagh | 2018-11-15T19:42:51 | Added more unittests for the extended-precision float. | diff --git a/src/atof/algorithm/correct.rs b/src/atof/algorithm/correct.rs
index ee7312f..7672a21 100644
--- a/src/atof/algorithm/correct.rs
+++ b/src/atof/algorithm/correct.rs
@@ -412,7 +412,7 @@ pub(super) fn to_extended<F, M>(mantissa: M, base: u32, exponent: i32, truncated
let fp = ExtendedFloat { frac: mantis... | 3 | 103 | 110 |
f03be884eb635799d006296dc7a0d19c35f06df6 | Alex Huszagh | 2018-11-14T09:18:17 | Removed macros from atof. | diff --git a/src/atof/api.rs b/src/atof/api.rs
index 5ac984e..f940b4d 100644
--- a/src/atof/api.rs
+++ b/src/atof/api.rs
@@ -14,31 +14,32 @@ cfg_if! {
}
}
-// MODULES
+/// Trait to define serialization of a float to string.
+pub(crate) trait FloatToString: Float {
+ /// Export float to base10 string with opt... | 3 | 98 | 69 |
fb5a7d5c5c41b34755c991dff0bc9b74879ec58e | Alex Huszagh | 2018-11-13T14:28:26 | Updated normalize to include the number of bits shifted and add is_normalized and imul functions. | diff --git a/src/atof/algorithm/correct.rs b/src/atof/algorithm/correct.rs
index 0ec0c0b..e5cede7 100644
--- a/src/atof/algorithm/correct.rs
+++ b/src/atof/algorithm/correct.rs
@@ -258,9 +258,9 @@ unsafe fn multiply_exponent_extended(mut fp: FloatType, base: u64, exponent: i32
let small = powers.small.get_unch... | 3 | 116 | 33 |
74bbd6998b955752b85d58f49cf68740fc55ed8e | Alex Huszagh | 2018-11-13T06:11:41 | Added initial version of extended-precision algorithm to correct parser. | diff --git a/src/atof/algorithm/cached.rs b/src/atof/algorithm/cached.rs
index aa51675..7216571 100644
--- a/src/atof/algorithm/cached.rs
+++ b/src/atof/algorithm/cached.rs
@@ -82,12 +82,14 @@
//! # Get our starting parameters
//! min_exp = math.floor(math.log(5e-324, base))
//! max_exp = math.ceil(math.... | 3 | 182 | 65 |
fed85023bf3b5e3e6b9bf260b0c62702dea31a7d | Alex Huszagh | 2018-11-12T23:16:18 | Moved float to root since it will be shared for atof code. | diff --git a/src/atof/algorithm/correct.rs b/src/atof/algorithm/correct.rs
index f011a09..2a14218 100644
--- a/src/atof/algorithm/correct.rs
+++ b/src/atof/algorithm/correct.rs
@@ -53,6 +53,8 @@ use util::*;
use super::super::double;
use super::super::float;
+// PARSE
+
/// Parse the mantissa from a string.
///
... | 5 | 166 | 134 |
60f72bac19ebb239c0ccf904556792d2232f6441 | Alex Huszagh | 2018-11-12T22:46:06 | Added unittests for to_exact_float and to_exact_double. | diff --git a/src/atof/algorithm/correct.rs b/src/atof/algorithm/correct.rs
index 79d1cb6..f011a09 100644
--- a/src/atof/algorithm/correct.rs
+++ b/src/atof/algorithm/correct.rs
@@ -160,7 +160,7 @@ macro_rules! to_exact {
if $exponent == 0 {
// 0 exponent, same as value, exact representatio... | 1 | 58 | 4 |
54da93e134a5f3aa84cf83ed09bebdb1054a288c | Alex Huszagh | 2018-11-12T22:28:50 | Bug fixes for no table and Grisu2. | diff --git a/src/ftoa/float.rs b/src/ftoa/float.rs
index d743046..7590f75 100644
--- a/src/ftoa/float.rs
+++ b/src/ftoa/float.rs
@@ -7,7 +7,7 @@
//! for performance). Since there is no storage for the sign bit,
//! this only works for positive floats.
-use super::util::*;
+use util::*;
// FLOAT TYPE
diff --git... | 3 | 16 | 12 |
8b945cfb58871694b4387bdc041471ff9debd5ee | Alex Huszagh | 2018-11-12T00:23:59 | Added partial fast path for the correct algorithm. | diff --git a/src/atof/algorithm/bigint.rs b/src/atof/algorithm/bigint.rs
index 841d8ea..d41fa50 100644
--- a/src/atof/algorithm/bigint.rs
+++ b/src/atof/algorithm/bigint.rs
@@ -1,5 +1,7 @@
//! Bigint implementation for
+// TODO(ahuszagh) Implement...
+
pub(crate) struct BigInt {
/// Internal storage for the nu... | 8 | 368 | 74 |
8e7d6bf638d381a26b73a18a73ce96e68f46bf39 | Alex Huszagh | 2018-11-11T16:06:50 | Use macros in itoa to allow default expansion to fast u32 type, otherwise, expand to wider type. | diff --git a/src/ftoa/basen.rs b/src/ftoa/basen.rs
index f51129e..28fc73f 100644
--- a/src/ftoa/basen.rs
+++ b/src/ftoa/basen.rs
@@ -6,7 +6,6 @@
use sealed::mem;
use sealed::ptr;
-use itoa::itoa_forward;
use util::*;
use super::util::*;
@@ -134,7 +133,7 @@ unsafe extern "C" fn ftoa_naive(d: f64, first: *mut u8,... | 3 | 169 | 166 |
025cb633972133be3d8167d0e95ca2a1aae83287 | Alex Huszagh | 2018-11-11T00:25:01 | Adding initial commit for correct algorithm. | diff --git a/Cargo.toml b/Cargo.toml
index 5273b28..a5bad9b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,9 +35,11 @@ lazy_static = "1"
ryu = "0.2"
[features]
-default = ["ryu", "std", "table"]
+default = ["ryu", "std", "table"] # "correct",
alloc = ["wee_alloc"]
nightly = ["alloc"]
+# Use the completely corr... | 9 | 444 | 279 |
0854de4d54cf87bf0122f31d2eac89ebfa5bb9a6 | Alex Huszagh | 2018-11-10T22:58:26 | Bug fix for serializing infinity and NaN strings with the high-level API. | diff --git a/Cargo.toml b/Cargo.toml
index 4f41019..5273b28 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical"
readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-lexical"
-version = "1.4.1"
+version = "1.4.2"
exclude = [
"benches/*",
]
diff... | 2 | 12 | 3 |
5b8927a95b35b11b0972bbc8de31e489e38e0850 | Alex Huszagh | 2018-11-10T22:44:09 | Removed spurious comment. | diff --git a/src/atoi.rs b/src/atoi.rs
index d9cbbfc..ad9ff43 100644
--- a/src/atoi.rs
+++ b/src/atoi.rs
@@ -180,7 +180,6 @@ macro_rules! atoi_signed {
} else if *$first == b'+' {
atoi_value!($first.add(1), $last, $base, $t)
} else if *$first == b'-' {
- // Unsigned types canno... | 1 | 0 | 1 |
49eebe7fadca19073c0d5c98fceb6dbf654779ae | Alex Huszagh | 2018-11-10T22:38:00 | Update for stability guarantee for Ryu. | diff --git a/Cargo.toml b/Cargo.toml
index f74a435..4f41019 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical"
readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-lexical"
-version = "1.4.0"
+version = "1.4.1"
exclude = [
"benches/*",
]
@@ -... | 2 | 5 | 5 |
179799b8c9d341f3dfa90c5b7ed880b5cf34851d | Alex Huszagh | 2018-11-10T03:32:17 | Added macros to avoid code duplication and added configurable infinity and NaN strings. | diff --git a/src/atof.rs b/src/atof.rs
index 18fbd02..1aa8115 100644
--- a/src/atof.rs
+++ b/src/atof.rs
@@ -55,7 +55,6 @@ use sealed::mem;
use sealed::ptr;
use ftoa::exponent_notation_char;
-use table::CHAR_TO_DIGIT;
use util::*;
// TRAITS
@@ -113,16 +112,14 @@ impl State {
unsafe extern "C" fn starts_with_na... | 7 | 92 | 40 |
12531cf969f60897a23fed975d7e6bcd567056f6 | Alex Huszagh | 2018-11-08T23:13:09 | Added usize/isize support. | diff --git a/Cargo.toml b/Cargo.toml
index c0193b2..292355a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical"
readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-lexical"
-version = "1.3.0"
+version = "1.3.1"
exclude = [
"benches/*",
]
diff... | 4 | 25 | 3 |
1c529704332e7a6073c83d498a99912110f69c81 | Alex Huszagh | 2018-11-08T22:52:09 | Update to use radix entirely for the high-level API. | diff --git a/Cargo.toml b/Cargo.toml
index 0f908f7..c0193b2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical"
readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-lexical"
-version = "1.2.1"
+version = "1.3.0"
exclude = [
"benches/*",
]
diff... | 3 | 28 | 20 |
e695fb73762900399dc9f3c48b224072d1fcafd5 | Alex Huszagh | 2018-11-08T19:39:14 | Update for 1.1 release. | diff --git a/Cargo.toml b/Cargo.toml
index 94173d4..ffd67f3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,7 @@ license = "MIT/Apache-2.0"
name = "lexical"
readme = "README.md"
repository = "https://github.com/AlexHuszagh/rust-lexical"
-version = "2.0.0"
+version = "1.1.0"
exclude = [
"benches/*",
]
diff... | 4 | 140 | 81 |
11d154ffe1590f21104a6464e4398d4c698d87b1 | Alex Huszagh | 2018-11-07T00:35:44 | Made the atoi implementation moregeneral, working on atof with precise floats from it. | diff --git a/Cargo.toml b/Cargo.toml
index a383393..f2999bf 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -28,7 +28,7 @@ dtoa = "0.4"
itoa = "0.4"
[features]
-default = ["std", "precise", "table"]
+default = ["std", "table"] # "precise",
alloc = ["wee_alloc"]
nightly = ["alloc"]
# Use extended-precision floats for... | 6 | 288 | 196 |
265b06f1add262519ac67bd7c6ca3d6f038ed370 | Alex Huszagh | 2018-11-06T00:16:43 | Added basic operations for the extended-precision float. | diff --git a/src/float.rs b/src/float.rs
index bdcc211..f8d75bc 100644
--- a/src/float.rs
+++ b/src/float.rs
@@ -9,18 +9,14 @@
//!
// DONE
// 1. Need to finish as_f64 and as_f32
+// 2. Need FloatType addition and subtraction.
+// 3. Also need a normalize_to exponent function.
//
// TODO(ahuszagh)
-// 1. Need ... | 2 | 300 | 61 |
4c1f0566ef3a65a1619964df54a483995b933032 | Alex Huszagh | 2018-11-01T00:17:14 | Bug fix for no features. | diff --git a/src/ftoa.rs b/src/ftoa.rs
index 4684727..bd9d2ac 100644
--- a/src/ftoa.rs
+++ b/src/ftoa.rs
@@ -793,6 +793,7 @@ string_impl!(f64toa_string, f64, f64toa_unsafe, BUFFER_SIZE);
// TESTS
// -----
+#[cfg(any(feature = "std", feature = "alloc"))]
#[cfg(test)]
mod tests {
use super::*;
@@ -804,7 +805,6... | 4 | 9 | 18 |
3f492f7be72c0349fb80d7bb657c89690e5ed3e5 | Alex Huszagh | 2018-10-31T23:52:27 | Bug fixes for rare memory corruption bug. | diff --git a/src/ftoa.rs b/src/ftoa.rs
index 6a221b0..4684727 100644
--- a/src/ftoa.rs
+++ b/src/ftoa.rs
@@ -84,7 +84,9 @@ pub extern "C" fn exponent_notation_char(base: u64)
// Simple, fast optimization.
// Since we're declaring a variable on the stack, and our power-of-two
// alignment dramatically improved atoi p... | 4 | 11 | 23 |
9056a3d5f6d3ad7946e3ecd6673aa610696fd1db | Alex Huszagh | 2018-10-31T23:07:11 | Test fix, since extremely low floats tend to fail with different radices. | diff --git a/src/ftoa.rs b/src/ftoa.rs
index 9ac11bb..6a221b0 100644
--- a/src/ftoa.rs
+++ b/src/ftoa.rs
@@ -798,7 +798,7 @@ mod tests {
// Test data for roundtrips.
const F32_DATA : [f32; 31] = [0., 0.1, 1., 1.1, 12., 12.1, 123., 123.1, 1234., 1234.1, 12345., 12345.1, 123456., 123456.1, 1234567., 1234567.1... | 2 | 2 | 1 |
899aac39a38e40adec20e67e7e396f4b8a4e9091 | Alex Huszagh | 2018-10-30T06:07:29 | Added no_std benchmarks. | diff --git a/src/itoa.rs b/src/itoa.rs
index 2ca0d51..8889838 100644
--- a/src/itoa.rs
+++ b/src/itoa.rs
@@ -42,6 +42,27 @@
//! test u64_itoa ... bench: 467,457 ns/iter (+/- 24,331)
//! test u64_to_string ... bench: 687,727 ns/iter (+/- 29,603)
//! ```
+//!
+//! Raw Benchmarks (`no_std`)
+//!
+//! ```te... | 1 | 21 | 0 |
27eda9455dac1e6e3b0167e839415c54124de032 | Alex Huszagh | 2018-10-30T06:02:51 | Made lexical work in a no_std context. | diff --git a/Cargo.toml b/Cargo.toml
index e05268f..edc2432 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,12 +13,18 @@ version = "0.0.1"
[badges]
travis-ci = { repository = "AlexHuszagh/rust-lexical" }
+[dependencies]
+# Global allocator only used during testing.
+wee_alloc = { version = "0.4", optional = true }
... | 4 | 125 | 12 |
d0f2a64eb22391188b8984f973b3d4abf5720fd5 | Tony Samuels | 2026-03-23T12:00:11 | fix: scientific formatting of 0 | diff --git a/src/decimal.rs b/src/decimal.rs
index 5017ceb..8f9b287 100644
--- a/src/decimal.rs
+++ b/src/decimal.rs
@@ -2712,4 +2712,10 @@ mod tests {
} else {
panic!()
};
+
+ #[test]
+ fn from_scientific_0e0() {
+ let dec = Decimal::from_scientific_exact("0e0").unwrap();
+ asser... | 2 | 26 | 0 |
13b586d0286417c9606d91914a50846a74d00d34 | Paul Mason | 2026-03-14T04:28:56 | Support scientific notation in Decimal::from_str() (#781)
On error from parse_str_radix_10, check for 'e'/'E' and dispatch to
from_scientific_lossy. Zero overhead on the happy path — benchmarks
show no regression for standard decimal parsing.
Fixes #722.
Co-authored-by: kofki <69553679+kofki@users.noreply.github.com... | diff --git a/src/decimal.rs b/src/decimal.rs
index 620b6b3..5017ceb 100644
--- a/src/decimal.rs
+++ b/src/decimal.rs
@@ -1994,8 +1994,13 @@ impl Num for Decimal {
impl FromStr for Decimal {
type Err = Error;
+ #[inline]
fn from_str(value: &str) -> Result<Decimal, Self::Err> {
- crate::str::parse_... | 2 | 24 | 1 |
4f59c3d8bfce6d49e71a7f40eb227cf006e7521e | Caio | 2026-03-14T03:47:21 | Allow the usage of fallible operations in constant environments (#750) | diff --git a/src/decimal.rs b/src/decimal.rs
index dcdeade..620b6b3 100644
--- a/src/decimal.rs
+++ b/src/decimal.rs
@@ -394,7 +394,7 @@ impl Decimal {
#[must_use]
pub fn new(num: i64, scale: u32) -> Decimal {
match Self::try_new(num, scale) {
- Err(e) => panic!("{}", e),
+ Err(... | 4 | 109 | 95 |
f0af1d296e47a3b896580b1e0d0e9783a82ca887 | Hugo Bastien | 2026-01-14T15:05:03 | Fix float to string loss of precision in serde arbitrary precision
Uses zmij for floating-point to string conversion to avoid precision
loss during deserialization.
This follows the same direction as serde_json:
https://github.com/serde-rs/json/pull/1304
Related to: https://github.com/paupino/rust-decimal/pull/761 | diff --git a/Cargo.toml b/Cargo.toml
index 2893d0f..c6e64e0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -32,6 +32,7 @@ rand-0_9 = { default-features = false, optional = true, package = "rand", versio
rust_decimal_macros = { path = "macros", default-features = false, optional = true, version = "1" }
rkyv = { default-f... | 2 | 39 | 1 |
5bfb589e380bfe471cfd7112cbc8b9098ebbd928 | sebadob | 2026-01-06T18:13:27 | remove line comment | diff --git a/Cargo.toml b/Cargo.toml
index d7e26d0..2893d0f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -30,7 +30,7 @@ postgres-types = { default-features = false, optional = true, version = "0.2" }
proptest = { default-features = false, optional = true, features = ["std"], version = "1.0" }
rand-0_9 = { default-feat... | 1 | 1 | 1 |
7861f33efb5b35449fd740f84ed055ed5ec32bd4 | sebadob | 2026-01-06T18:11:16 | pin `rykv` to `0.7.46` | diff --git a/Cargo.toml b/Cargo.toml
index 7e8c3a7..d7e26d0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -30,7 +30,7 @@ postgres-types = { default-features = false, optional = true, version = "0.2" }
proptest = { default-features = false, optional = true, features = ["std"], version = "1.0" }
rand-0_9 = { default-feat... | 1 | 2 | 2 |
c52f1f12931dcd21956189e3f48e8baedb7e3f31 | Paul Mason | 2025-10-12T18:38:05 | Remove doc_auto_cfg and address lifetime warnings (#755) | diff --git a/macros/src/str.rs b/macros/src/str.rs
index e7d2963..7ad07df 100644
--- a/macros/src/str.rs
+++ b/macros/src/str.rs
@@ -76,8 +76,8 @@ impl Display for ParseError<'_> {
}
}
-pub const fn parse_decimal(src: &str, exp: i32) -> ParseResult {
- const fn skip_us(radix: u32, is_positive: bool, mut src:... | 2 | 6 | 6 |
9da94d0be903d4c7a4a6f3f7c2aeb6713fcfcd70 | Aumetra Weisman | 2025-05-29T17:52:21 | `postgres` -> `postgres_backend` | diff --git a/Cargo.toml b/Cargo.toml
index 908de65..a332939 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -42,7 +42,7 @@ bincode = { default-features = false, version = "1.0" }
bytes = { default-features = false, version = "1.0" }
criterion = { default-features = false, version = "0.5" }
csv = "1"
-diesel = { default-... | 1 | 2 | 2 |
8e97c2c268fdfbba524f05ed01a9286f07d4bbdc | Caio | 2025-09-15T20:32:31 | Work towards more constant methods (#749) | diff --git a/src/decimal.rs b/src/decimal.rs
index 06c8bc7..f815635 100644
--- a/src/decimal.rs
+++ b/src/decimal.rs
@@ -573,25 +573,29 @@ impl Decimal {
/// # Ok(())
/// # }
/// ```
- pub fn from_scientific_exact(value: &str) -> Result<Decimal, Error> {
+ pub fn from_scientific_exact(value: &s... | 4 | 21 | 13 |
5a8236a77be11ca6180960e791dee8951f7a0a1f | tenuous-guidance | 2025-09-04T12:19:18 | Add from_scientific_exact, that behaves like v1's from scientific, and change from_scientific to match from_str's behaviour
This makes the scientific parsing implementation consistent with from_str and from_str_exact | diff --git a/src/decimal.rs b/src/decimal.rs
index 883cd57..06c8bc7 100644
--- a/src/decimal.rs
+++ b/src/decimal.rs
@@ -555,7 +555,8 @@ impl Decimal {
}
/// Returns a `Result` which if successful contains the `Decimal` constitution of
- /// the scientific notation provided by `value`.
+ /// the scien... | 2 | 146 | 7 |
96f63fc92da24c8c947361535cb8ecbb29b341b5 | Tony Samuels | 2025-08-24T17:12:40 | add validation to borsh deser
Resolves #743 | diff --git a/src/borsh.rs b/src/borsh.rs
new file mode 100644
index 0000000..cb40b41
--- /dev/null
+++ b/src/borsh.rs
@@ -0,0 +1,40 @@
+use std::io;
+
+use borsh::BorshDeserialize;
+
+use crate::{
+ Decimal, Error,
+ constants::{SCALE_MASK, SCALE_SHIFT, SIGN_MASK},
+};
+
+impl borsh::BorshDeserialize for Decimal ... | 4 | 83 | 5 |
39445882f76e4b82499c443a4fe181f5c308703f | Finn Bear | 2025-08-13T02:18:20 | Add `#[inline]` to `Decimal::from_parts` for performance | diff --git a/src/decimal.rs b/src/decimal.rs
index 99674e1..91197ea 100644
--- a/src/decimal.rs
+++ b/src/decimal.rs
@@ -522,6 +522,7 @@ impl Decimal {
/// let pi = Decimal::from_parts(1102470952, 185874565, 1703060790, false, 28);
/// assert_eq!(pi.to_string(), "3.1415926535897932384626433832");
/// ```... | 1 | 1 | 0 |
149cbf7d73551f4ffe1db9ce175265dc1739d1b1 | David Weikersdorfer | 2025-07-27T17:27:41 | Improved exp
Improved algorithm to compute exp (and thus also pow) to not compute
x^i directly in the Taylor series as it quickly outgrows exp(x).
Instead the summand is grown with x/i. exp can no be computed for
values up to ~66.5
Additionally the loop avoids two unnecessary ops for the tolerance
check and does not ... | diff --git a/benches/lib_benches.rs b/benches/lib_benches.rs
index 5757c91..92cb4bc 100644
--- a/benches/lib_benches.rs
+++ b/benches/lib_benches.rs
@@ -288,6 +288,21 @@ mod maths {
});
}
+ #[bench]
+ fn exp_large(b: &mut ::test::Bencher) {
+ let samples = &[
+ Decimal::from_str(... | 3 | 71 | 33 |
7da20086aa479484a7d9c11ed126ad45396aad74 | tenuous-guidance | 2025-09-04T12:19:18 | Add from_scientific_round, that parses like from_scientific but behaves like from_str for numbers with greater precision that Decimal supports | diff --git a/src/decimal.rs b/src/decimal.rs
index 5268433..3dc6164 100644
--- a/src/decimal.rs
+++ b/src/decimal.rs
@@ -637,6 +637,102 @@ impl Decimal {
Ok(ret)
}
+ /// Returns a `Result` which if successful contains the `Decimal` constitution of
+ /// the scientific notation provided by `value`.... | 2 | 138 | 0 |
5b2693034d82cac70da57d52a7f6e246f85e6c04 | tenuous-guidance | 2025-09-04T12:19:18 | Add from_scientific_exact, that behaves like v1's from scientific, and change from_scientific to match from_str's behaviour
This makes the scientific parsing implementation consistent with from_str and from_str_exact | diff --git a/src/decimal.rs b/src/decimal.rs
index 91197ea..6bf485b 100644
--- a/src/decimal.rs
+++ b/src/decimal.rs
@@ -556,7 +556,8 @@ impl Decimal {
}
/// Returns a `Result` which if successful contains the `Decimal` constitution of
- /// the scientific notation provided by `value`.
+ /// the scien... | 2 | 146 | 7 |
2b0b9ba3afe631c611137aeeec6cc1e27820ff9a | Finn Bear | 2025-08-13T21:12:21 | Add `#[inline]` to `Decimal::from_parts` | diff --git a/src/decimal.rs b/src/decimal.rs
index 1fc7dd1..5268433 100644
--- a/src/decimal.rs
+++ b/src/decimal.rs
@@ -525,6 +525,7 @@ impl Decimal {
/// let pi = Decimal::from_parts(1102470952, 185874565, 1703060790, false, 28);
/// assert_eq!(pi.to_string(), "3.1415926535897932384626433832");
/// ```... | 1 | 1 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.