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
edaf9a1bc362daed03d62242dd3c794d7802be47
Anton Lazarev
2018-12-05T16:08:43
add set_file_mtime and set_file_atime for unix platforms
diff --git a/src/lib.rs b/src/lib.rs index 8b060d0..f357d80 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -207,7 +207,7 @@ pub fn set_file_times<P>(p: P, atime: FileTime, mtime: FileTime) -> io::Result<()> where P: AsRef<Path> { - imp::set_file_times(p.as_ref(), atime, mtime) + imp::set_file_times(p.as_r...
7
125
21
f46543c05e0a15a6998f6d1182ffe767a17f8c44
Alex Crichton
2019-04-23T16:47:16
Bump to 0.2.5
diff --git a/Cargo.toml b/Cargo.toml index 6242dd1..2bffdb6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.2.4" +version = "0.2.5" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mtime...
1
1
1
92f3170bf07444163a0a5929e5707b003351e317
Matthieu Pizenberg
2019-04-22T20:29:49
Return an Err instead of panicking
diff --git a/src/wasm.rs b/src/wasm.rs index e17dec8..f45ba5a 100644 --- a/src/wasm.rs +++ b/src/wasm.rs @@ -6,11 +6,11 @@ use std::{fs, io}; use FileTime; pub fn set_file_times(p: &Path, atime: FileTime, mtime: FileTime) -> io::Result<()> { - unimplemented!() + Err(io::Error::new(io::ErrorKind::Other, "Wasm ...
1
2
2
4ec567ddf94ef26399c69b12c7d12022df07ba43
Matthieu Pizenberg
2019-04-21T07:56:09
Do not crash when compiling to wasm
diff --git a/src/lib.rs b/src/lib.rs index 8972518..8b060d0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,6 +50,9 @@ cfg_if! { } else if #[cfg(windows)] { #[path = "windows.rs"] mod imp; + } else if #[cfg(target_arch = "wasm32")] { + #[path = "wasm.rs"] + mod imp; } else {...
2
29
0
ca6788970a037c54d2287aa9769ea8436a4b72e2
Finkelman
2019-01-08T03:40:42
remove the unued import
diff --git a/src/lib.rs b/src/lib.rs index 2e6fcd4..8972518 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -37,7 +37,6 @@ #[macro_use] extern crate cfg_if; -use std::env; use std::fmt; use std::fs; use std::io;
1
0
1
18ce78353a0837d840dc80f2bbecc5463a827f4f
Derk Bell
2018-11-26T09:01:27
libc has been updated, utimensat supported on freebsd and netbsd
diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 9c28aa4..71ea411 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -15,12 +15,11 @@ cfg_if! { if #[cfg(target_os = "linux")] { mod linux; pub use self::linux::*; - // netbsd, openbsd and freebsd should use utimensat, but the call is not ...
1
2
3
8fb4a319cb494c3702ffaad17036c432406dcf3c
Alex Crichton
2018-11-17T08:20:38
Bump to 0.2.4
diff --git a/Cargo.toml b/Cargo.toml index b8bfaa7..6242dd1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.2.3" +version = "0.2.4" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mtime...
1
1
1
ef26710c338421ff154cad70150f087b9c8dd361
Alex Crichton
2018-11-12T15:22:52
Bump to 0.2.3
diff --git a/Cargo.toml b/Cargo.toml index e5cb649..b8bfaa7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.2.2" +version = "0.2.3" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mtime...
1
1
1
32fa04c83bf2dcb503f9473f4af6040a8aaca8f0
Laurence Tratt
2018-11-15T18:53:30
OpenBSD doesn't have lutimes so use utimensat instead.
diff --git a/src/unix/mod.rs b/src/unix/mod.rs index c4cc774..9c28aa4 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -20,7 +20,8 @@ cfg_if! { // these target_os'es should be added back in. } else if #[cfg(any(target_os = "android", target_os = "solaris", - ...
1
2
1
db5cc8d3efaed39007a200f36d2e4a3ec75681ea
Derk Bell
2018-11-12T09:31:43
missing libc def for utimensat in 0.2.43, *bsd targets should use utimes until a new version is available
diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 0c95e8e..c4cc774 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -15,11 +15,11 @@ cfg_if! { if #[cfg(target_os = "linux")] { mod linux; pub use self::linux::*; + // netbsd, openbsd and freebsd should use utimensat, but the call is not ...
1
3
3
df8da97ee26e9262246630ddca73561d823e0cc7
Alex Crichton
2018-11-05T16:08:46
Bump to 0.2.2
diff --git a/Cargo.toml b/Cargo.toml index 9dfcec2..e5cb649 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.2.1" +version = "0.2.2" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mtime...
1
1
1
1f4cc28d6cf59465f035fa0e4f079e2172ddb9e1
Pierre Krieger
2018-11-04T02:03:29
Fix Emscripten and FreeBSD
diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 8cca815..0c95e8e 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -18,7 +18,9 @@ cfg_if! { } else if #[cfg(any(target_os = "android", target_os = "solaris", target_os = "netbsd", - tar...
1
3
1
6ff139a4b465496bd6caf9eb0e45d6eee02ea590
Dror Levin
2018-06-27T18:11:59
Implement From<SystemTime> for FileTime, fix #25
diff --git a/src/lib.rs b/src/lib.rs index 7b7846e..f5f3119 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -182,6 +182,12 @@ impl fmt::Display for FileTime { } } +impl From<SystemTime> for FileTime { + fn from(time: SystemTime) -> FileTime { + FileTime::from_system_time(time) + } +} + /// Set the las...
1
6
0
c5bf02d09395747a9f6baa0fa058f1d1b799f73b
Alex Crichton
2018-05-03T13:51:37
Bump to 0.2.1
diff --git a/Cargo.toml b/Cargo.toml index 7c97168..9dfcec2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.2.0" +version = "0.2.1" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mtime...
1
1
1
3103145679fde536db59a4d29a18f7500e5682e1
Alex Crichton
2018-05-03T13:48:00
Update Cargo.toml doc url
diff --git a/Cargo.toml b/Cargo.toml index 5150ca5..7c97168 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ readme = "README.md" keywords = ["timestamp", "mtime"] repository = "https://github.com/alexcrichton/filetime" homepage = "https://github.com/alexcrichton/filetime" -documentation = "http://alexcricht...
1
1
1
e1c4df97ef86507db76e2db65db4cf96acc766ea
Alex Crichton
2018-04-25T14:47:12
Fix overflow on 32-bit Closes #23
diff --git a/src/lib.rs b/src/lib.rs index 7ceae91..7b7846e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -301,8 +301,8 @@ mod tests { assert_eq!(-2, time.seconds); assert_eq!(900_000_000, time.nanos); - let time = FileTime::from_system_time(UNIX_EPOCH - Duration::from_secs(12_000_000_000)); - ...
1
2
2
80c6c15bc287526a1c831b7aa140a417bae13abf
Oliver Hamlet
2018-03-27T07:09:11
Rename from_seconds_since_1970(), seconds_relative_to_1970() I think the new names are less ambiguous, and are more consistent with the other FileTime methods.
diff --git a/src/lib.rs b/src/lib.rs index 6a3b047..7ceae91 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,7 +27,7 @@ //! assert!(mtime < atime); //! //! // Inspect values that can be interpreted across platforms -//! println!("{}", mtime.seconds_relative_to_1970()); +//! println!("{}", mtime.unix_seconds()); //! ...
1
16
16
f8dd165f6a4a1485d7140be2aa1da9a6a9769323
Oliver Hamlet
2018-03-26T21:20:09
Support signed seconds input and output values
diff --git a/src/lib.rs b/src/lib.rs index 0db3dd7..6a3b047 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -76,16 +76,19 @@ impl FileTime { } /// Creates a new instance of `FileTime` with a number of seconds and - /// nanoseconds relative to January 1, 1970. + /// nanoseconds relative to the Unix epoch, ...
3
79
9
f301e8ada76e0539812d0ec32ea574374f702d20
Oliver Hamlet
2018-03-24T17:19:43
Add function to create FileTime from SystemTime This requires that FileTime can handle negative Unix timestamps on non-Windows OSes. To prevent breaking existing API functions, they now cast from signed to unsigned integers, but this may cause overflow-related issues. Nanoseconds have been left unsigned as it's harde...
diff --git a/src/lib.rs b/src/lib.rs index b9c8afe..0db3dd7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -41,6 +41,7 @@ use std::fmt; use std::fs; use std::io; use std::path::Path; +use std::time::{Duration, SystemTime, UNIX_EPOCH}; cfg_if! { if #[cfg(target_os = "redox")] { @@ -62,7 +63,7 @@ cfg_if! { /// s...
4
83
10
b23513a0f69088bb5dd34a315721f13bbf1c6656
Marco A L Barbosa
2018-01-25T12:33:31
Fix compilation for x86_64-unknown-linux-gnux32 target
diff --git a/src/unix/mod.rs b/src/unix/mod.rs index e1f7ce4..5e6dbdd 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -6,7 +6,7 @@ use std::io; use std::os::unix::prelude::*; use std::path::Path; -use self::libc::{c_int, c_char, timeval, time_t, suseconds_t, c_long}; +use self::libc::{c_int, c_char, timeval, ...
1
2
2
396a21b479e0bdd64d7ae1e7e1e084f090b8305c
Alex Crichton
2018-01-17T23:05:59
Bump to 0.1.15
diff --git a/Cargo.toml b/Cargo.toml index da44c23..ccdba6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.1.14" +version = "0.1.15" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mti...
1
1
1
8f676874831a94c0c0201ac2f46dc871975b32b3
Josh Stone
2018-01-17T21:01:39
Add a fallback for utimensat ENOSYS Even when libc has `utimensat`, the kernel may return `ENOSYS`, and then we'll need to use the `utimes` fallback instead.
diff --git a/src/unix/linux.rs b/src/unix/linux.rs index 33bd92c..d378c9e 100644 --- a/src/unix/linux.rs +++ b/src/unix/linux.rs @@ -6,22 +6,39 @@ use std::io; use std::mem; use std::path::Path; use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT}; +use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT};...
1
24
7
120488908bacd463bd5f0fe821bfcc2029f6eb40
Alex Crichton
2017-10-07T16:08:30
Bump to 0.1.14
diff --git a/Cargo.toml b/Cargo.toml index 0717476..da44c23 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.1.13" +version = "0.1.14" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mti...
1
1
1
dfb9f81980bfc1765e36e4ea90a2147f5c2c8ba7
Alex Crichton
2017-10-07T16:07:11
Fall back to `utimes` on Linux
diff --git a/src/lib.rs b/src/lib.rs index 00adb25..b9c8afe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,13 +49,8 @@ cfg_if! { } else if #[cfg(windows)] { #[path = "windows.rs"] mod imp; - } else if #[cfg(any(target_os = "linux", target_os = "android", - target_os = "...
6
120
82
7ecf7cfef57585f178aac98b93901fee8d148330
Sébastien Marie
2017-10-07T04:39:53
bump version to 0.1.13
diff --git a/Cargo.toml b/Cargo.toml index f495048..0717476 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.1.12" +version = "0.1.13" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mti...
1
1
1
a6140a6fa3a6b2c0f972bd84de91d56a4198882a
Sébastien Marie
2017-10-03T11:33:52
use utimensat for netbsd and openbsd
diff --git a/src/lib.rs b/src/lib.rs index c65ecdb..00adb25 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,7 +49,9 @@ cfg_if! { } else if #[cfg(windows)] { #[path = "windows.rs"] mod imp; - } else if #[cfg(any(target_os = "linux", target_os = "android", target_os = "solaris"))] { + } else ...
1
3
1
95b071506812d4cf894992c4e9f5737215b37b6a
bgermann
2017-09-24T09:47:05
Use utimensat module for Solaris Closes #14. Depends on rust-lang/libc/pull/780.
diff --git a/src/lib.rs b/src/lib.rs index d1e3b46..c65ecdb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,7 +49,7 @@ cfg_if! { } else if #[cfg(windows)] { #[path = "windows.rs"] mod imp; - } else if #[cfg(any(target_os = "linux", target_os = "android"))] { + } else if #[cfg(any(target_os ...
1
1
1
1231f8a128b5af5fedfd117a7fc9c1800fabaeae
Alex Crichton
2017-09-23T22:07:37
Use utimensat where possible Currently only for Linux and Android
diff --git a/Cargo.toml b/Cargo.toml index 33a92ed..f495048 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,9 @@ description = """ Platform-agnostic accessors of timestamps in File metadata """ +[dependencies] +cfg-if = "0.1" + [target.'cfg(unix)'.dependencies] libc = "0.2" diff --git a/src/lib.rs b/src/l...
4
86
17
b32b97b1e0b346af95538bf19f9e042589ce0e3e
Alex Crichton
2017-09-20T14:53:12
Bump to 0.1.12
diff --git a/Cargo.toml b/Cargo.toml index e0b359c..33a92ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.1.11" +version = "0.1.12" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mti...
1
1
1
36e9889f8ffc99b98bbaf58a2a5c882170b7d2d2
Alex Crichton
2017-09-20T14:52:50
Avoid using deprecated method
diff --git a/src/unix.rs b/src/unix.rs index 86e1164..41e9cca 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -69,10 +69,9 @@ pub fn from_creation_time(meta: &fs::Metadata) -> Option<FileTime> { #[cfg(target_os = $e)] use std::os::$i::fs::MetadataExt; )* - ...
1
2
3
9719f39529741794af65613f9d5c6eb3ef6b97ab
Alex Crichton
2017-09-20T14:49:23
Fix build on Android
diff --git a/src/unix.rs b/src/unix.rs index b2c92e2..86e1164 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -14,6 +14,12 @@ pub fn set_file_times(p: &Path, atime: FileTime, mtime: FileTime) -> io::Result< set_file_times_u(p, atime, mtime, libc::utimes) } +#[cfg(target_os = "android")] +pub fn set_symlink_file_t...
1
6
0
cdc7cd9f4c65745bccd4c56d68e5abc0e50322f7
Alex Crichton
2017-09-20T14:48:27
Refactor into platform-specific modules
diff --git a/Cargo.toml b/Cargo.toml index feb522e..e0b359c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,12 +12,9 @@ description = """ Platform-agnostic accessors of timestamps in File metadata """ -[dependencies] +[target.'cfg(unix)'.dependencies] libc = "0.2" -[target.'cfg(windows)'.dependencies] -winapi = ...
5
256
224
0764c6386f3b54b7bf812390f1e86f2b9140eff1
Alex Crichton
2017-09-19T14:07:18
Bump to 0.1.11
diff --git a/Cargo.toml b/Cargo.toml index 328442b..feb522e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.1.10" +version = "0.1.11" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mti...
1
1
1
1c667da38069efe3296fb83ef0537a22233e73df
Ian Douglas Scott
2017-08-15T00:36:33
redox: fix setting times on readonly file
diff --git a/src/lib.rs b/src/lib.rs index 1fac780..b72facf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -271,14 +271,14 @@ fn set_file_times_u<ST>(p: &Path, atime: FileTime, mtime: FileTime, utimes: ST) #[cfg(target_os = "redox")] fn set_file_times_(p: &Path, atime: FileTime, mtime: FileTime) -> io::Result<()> { - ...
1
2
2
f6689685f23dcef4b5f0a8f460678fe5f3d63179
Ian Douglas Scott
2017-07-09T22:49:29
Redox OS support
diff --git a/Cargo.toml b/Cargo.toml index 054e0bb..328442b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,5 +18,8 @@ libc = "0.2" [target.'cfg(windows)'.dependencies] winapi = "0.2" +[target.'cfg(target_os = "redox")'.dependencies] +redox_syscall = "0.1" + [dev-dependencies] tempdir = "0.3" diff --git a/src/lib...
2
43
4
5c2ceb13cff7ba522ad8f750411cc49aee055c13
Brian Olsen
2017-05-14T13:36:15
Add set_symlink_file_times that doesn't follow symlinks This adds the method set_symlink_file_times that doesn't follow symlinks and instead sets the time of the symlink itself. Because implementations of set_file_times and set_symlink_file_times are so similar for both windows and unix I have also refactor the code ...
diff --git a/Cargo.toml b/Cargo.toml index 971eaf6..054e0bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,5 +15,8 @@ Platform-agnostic accessors of timestamps in File metadata [dependencies] libc = "0.2" +[target.'cfg(windows)'.dependencies] +winapi = "0.2" + [dev-dependencies] tempdir = "0.3" diff --git a/src/...
2
125
8
c53b18a798f203132c0a27cf7c8705517fa73bd4
Brian Olsen
2017-05-14T13:35:00
Add symlink tests of set_file_times set_file_times follows symlinks and sets the time on the file pointed to instead of the symlink itself. This adds tests for this behavior.
diff --git a/src/lib.rs b/src/lib.rs index ebd9bf2..53730df 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -301,5 +301,30 @@ mod tests { let metadata = fs::metadata(&path).unwrap(); let mtime = FileTime::from_last_modification_time(&metadata); assert_eq!(mtime, new_mtime); + + let spath =...
1
25
0
edb4fe7f266df5b3425b2ddfd726b2460ba3aa3c
Alex Chan
2016-07-16T17:39:34
Fix typo in doc comment
diff --git a/src/lib.rs b/src/lib.rs index aa6bec1..ebd9bf2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,7 @@ //! //! # Installation //! -//! Add this to you `Cargo.toml`: +//! Add this to your `Cargo.toml`: //! //! ```toml //! [dependencies]
1
1
1
cd6c44962305d4c434c81aad9d78f3a1d90644f9
Alex Crichton
2016-02-13T08:33:17
Bump to 0.1.10
diff --git a/Cargo.toml b/Cargo.toml index 7d144b6..971eaf6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.1.9" +version = "0.1.10" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mtim...
1
1
1
76fc14dcf69cf336c8667b031867522cf042203c
Alex Crichton
2016-02-13T08:33:03
Just inline definitions from winapi
diff --git a/Cargo.toml b/Cargo.toml index 11d4aec..7d144b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,8 +14,6 @@ Platform-agnostic accessors of timestamps in File metadata [dependencies] libc = "0.2" -kernel32-sys = "0.2" -winapi = "0.2" [dev-dependencies] tempdir = "0.3" diff --git a/src/lib.rs b/src/lib...
2
19
8
554315446984e142e811d6d72aa657fcc89c12bd
Alex Crichton
2015-12-23T17:24:34
Bump to 0.1.9
diff --git a/Cargo.toml b/Cargo.toml index ef167d4..11d4aec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.1.8" +version = "0.1.9" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mtime...
1
1
1
a52fa17be95eb884546b731e7b2585e829d8fd4b
Alex Crichton
2015-12-23T17:24:11
Add a cast to fix 1.5 Closes #4
diff --git a/src/lib.rs b/src/lib.rs index bfbeab7..ed41b95 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -219,7 +219,7 @@ fn set_file_times_(p: &Path, atime: FileTime, mtime: FileTime) -> io::Result<()> let times = [to_timeval(&atime), to_timeval(&mtime)]; let p = try!(CString::new(p.as_os_str().as_bytes())); ...
1
1
1
a0e0c095203c2f0bddfda037b7f25d7f4628e717
Alex Crichton
2015-11-20T20:39:11
Bump to 0.1.8
diff --git a/Cargo.toml b/Cargo.toml index afb5c88..ef167d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.1.7" +version = "0.1.8" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mtime...
1
1
1
bdadb500736375ba77dbd1da0c79832e97ba10d7
Alex Crichton
2015-11-20T20:38:57
Bump kernel32-sys dep
diff --git a/Cargo.toml b/Cargo.toml index c490d23..afb5c88 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ Platform-agnostic accessors of timestamps in File metadata [dependencies] libc = "0.2" -kernel32-sys = "0.1" +kernel32-sys = "0.2" winapi = "0.2" [dev-dependencies]
1
1
1
8e59589eb104c1aa590656f7476cd77d1a5a1c78
Alex Crichton
2015-11-17T18:14:56
Bump to 0.1.7
diff --git a/Cargo.toml b/Cargo.toml index a9449cf..c490d23 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.1.6" +version = "0.1.7" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mtime...
1
1
1
b6671c479945ca5e5b14c70db8ee0d7d675c5def
Alex Crichton
2015-11-03T21:36:43
Bump dep on libc
diff --git a/Cargo.toml b/Cargo.toml index 9637390..a9449cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ Platform-agnostic accessors of timestamps in File metadata """ [dependencies] -libc = "0.1" +libc = "0.2" kernel32-sys = "0.1" winapi = "0.2" diff --git a/src/lib.rs b/src/lib.rs index a8f3bdf....
2
2
6
54bcb5f4a2440a01bbc403344e7cc3936bd99d2a
Alex Crichton
2015-10-03T19:23:40
Bump to 0.1.6
diff --git a/Cargo.toml b/Cargo.toml index ccbf114..9637390 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.1.5" +version = "0.1.6" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mtime...
1
1
1
392fca98bf0c8b0cd058fd07cfe3cb1294e6e84c
Alex Crichton
2015-10-03T19:23:26
Derive Hash for FileTime
diff --git a/src/lib.rs b/src/lib.rs index 979367a..a8f3bdf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -51,7 +51,7 @@ use std::path::Path; /// The actual value contined within is platform-specific and does not have the /// same meaning across platforms, but comparisons and stringification can be /// significant amo...
1
1
1
b713155c577cfef68bbd9aefe6c5bd8991e8d1b8
Alex Crichton
2015-07-29T17:14:41
Bump to 0.1.5
diff --git a/Cargo.toml b/Cargo.toml index 07e4300..ccbf114 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.1.4" +version = "0.1.5" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mtime...
1
1
1
182c7aa44697dcc997fd7ecee6e9fe745cc9c938
Alex Crichton
2015-07-29T17:09:41
Add from_seconds_since_1970 + set_file_times This should help managing timestamps on files in general.
diff --git a/Cargo.toml b/Cargo.toml index 096a412..07e4300 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,3 +11,11 @@ documentation = "http://alexcrichton.com/filetime" description = """ Platform-agnostic accessors of timestamps in File metadata """ + +[dependencies] +libc = "0.1" +kernel32-sys = "0.1" +winapi = "...
2
121
0
584a85ee71fbb2b21218d5fb2871ffbc2939fabb
Alex Crichton
2015-06-13T17:17:51
Bump to 0.1.4
diff --git a/Cargo.toml b/Cargo.toml index aba1852..096a412 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.1.3" +version = "0.1.4" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mtime...
1
1
1
f4d739441da138c7d3afde88a780663bafd92e86
Alex Crichton
2015-05-29T20:50:19
Bump to 0.1.3
diff --git a/Cargo.toml b/Cargo.toml index c3c9393..aba1852 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.1.2" +version = "0.1.3" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mtime...
1
1
1
67b453d8ec900188239182529795c14801c12c77
Alex Crichton
2015-05-29T20:50:00
Use nanos now that the stdlib has fixed the bug
diff --git a/src/lib.rs b/src/lib.rs index ac2f9fb..e2f2166 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -121,11 +121,8 @@ impl FileTime { } #[cfg(unix)] - fn from_os_repr(seconds: u64, _nanos: u32) -> FileTime { - // FIXME: currently there is a bug in the standard library where the - // ...
1
2
5
60a58b2f324d99328844a364a9cb9c1f5a575e5d
Alex Crichton
2015-05-05T18:43:27
Fix compile on windows
diff --git a/Cargo.toml b/Cargo.toml index 7d42961..c3c9393 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.1.1" +version = "0.1.2" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mtime...
2
2
2
5accc19ecaa8706808ef06130dd553cec629d223
Alex Crichton
2015-05-04T23:14:10
Bump to 0.1.1
diff --git a/Cargo.toml b/Cargo.toml index 820abf5..7d42961 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "filetime" authors = ["Alex Crichton <alex@alexcrichton.com>"] -version = "0.1.0" +version = "0.1.1" license = "MIT/Apache-2.0" readme = "README.md" keywords = ["timestamp", "mtime...
1
1
1
cae45bceb5767e5f474ce117d7a3df764f8a8913
Alex Crichton
2015-05-04T23:13:42
Add an accessor for seconds relative to 1970
diff --git a/src/lib.rs b/src/lib.rs index 75ae5eb..1470e4a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -135,6 +135,15 @@ impl FileTime { /// Windows platforms time stamps are relative to January 1, 1601. pub fn seconds(&self) -> u64 { self.seconds } + /// Returns the whole number of seconds represented ...
1
9
0
64b7d7bac0e94c8c0ffeca9ea30bc8ffe802fa2f
Alex Crichton
2015-05-04T23:09:28
Fix compilation on OSX and friends
diff --git a/src/lib.rs b/src/lib.rs index cdc337b..75ae5eb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,9 @@ #![feature(metadata_ext)] +#![cfg_attr(any(target_os = "bitrig", + target_os = "freebsd", + target_os = "ios", + target_os = "macos", + target...
1
7
3
7f0243e737024a617162f2e61d33866559775287
Andrew Kubera
2025-12-27T22:50:32
Begin v0.4.11 development
diff --git a/Cargo.lock b/Cargo.lock index 8a96024..182c85e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,7 +8,7 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "bigdecimal" -version = "0.4.10" +version = "0.4.11+dev" dependencies = [ "autocfg", "libm", diff...
2
2
2
a53d3af14ae086e11613326b378a018298bbefdb
Andrew Kubera
2025-12-27T22:49:54
Version 0.4.10
diff --git a/Cargo.lock b/Cargo.lock index ac44185..8a96024 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,7 +8,7 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "bigdecimal" -version = "0.4.10+dev" +version = "0.4.10" dependencies = [ "autocfg", "libm", diff...
2
2
2
6d8fd8355f2aa38f10d3b4c804f90d2a4cbd6369
Andrew Kubera
2025-08-12T14:16:14
Enforce decimal precision in sqrt tests
diff --git a/src/arithmetic/sqrt.tests.rs b/src/arithmetic/sqrt.tests.rs index dac1e5d..adc462e 100644 --- a/src/arithmetic/sqrt.tests.rs +++ b/src/arithmetic/sqrt.tests.rs @@ -6,9 +6,9 @@ macro_rules! impl_case { let n: BigDecimal = $input.parse().unwrap(); let value = n.sqrt().unwrap(); - ...
1
12
12
c1f8f91a62c7081bb2612cf7af8257cea5fb67c1
Andrew Kubera
2025-08-12T14:16:14
Move sqrt tests into sqrt.tests.rs
diff --git a/src/arithmetic/sqrt.rs b/src/arithmetic/sqrt.rs index 3c78070..0fd284b 100644 --- a/src/arithmetic/sqrt.rs +++ b/src/arithmetic/sqrt.rs @@ -32,132 +32,5 @@ pub(crate) fn impl_sqrt(n: &BigUint, scale: i64, ctx: &Context) -> BigDecimal { mod test { use super::*; - macro_rules! impl_case { - ...
2
130
128
95dff411a1bc50e209c8fbb4f945447d353c4e01
Andrew Kubera
2025-10-21T05:13:09
Add methods for constructing DigitVec from u128
diff --git a/src/bigdigit/digitvec.rs b/src/bigdigit/digitvec.rs index c6c45ea..0a165af 100644 --- a/src/bigdigit/digitvec.rs +++ b/src/bigdigit/digitvec.rs @@ -70,6 +70,18 @@ impl<R: RadixType, E: Endianness> DigitVec<R, E> { self.digits.truncate(n); } + /// construct digitvec with u128 + pub(cra...
2
34
0
9bf2efc3bd32f1c624ddc8157461ca191b98d1cd
Andrew Kubera
2025-10-20T23:22:27
Correct index at which we add carry
diff --git a/src/bigdigit/digitvec.rs b/src/bigdigit/digitvec.rs index dc68648..c6c45ea 100644 --- a/src/bigdigit/digitvec.rs +++ b/src/bigdigit/digitvec.rs @@ -156,7 +156,7 @@ impl<R: RadixType, E: Endianness> DigitVec<R, E> { return; } - let overflow = self.as_digit_slice_mut().add_valu...
1
1
1
105eb60b3579ed1282f708c8998c52a6dddc83b4
Andrew Kubera
2025-11-28T17:09:03
Update doc-comments in bigdigit/alignment
diff --git a/src/bigdigit/alignment.rs b/src/bigdigit/alignment.rs index 729148c..3b73876 100644 --- a/src/bigdigit/alignment.rs +++ b/src/bigdigit/alignment.rs @@ -108,10 +108,12 @@ where R: RadixPowerOfTen, I: Iterator<Item = R::Base>, { + /// Wrap iterator with on shifting pub fn new(iter: I) -> S...
1
8
0
05717322f556dddf193a15e381a85995c942dcf7
Andrew Kubera
2025-11-13T03:47:27
Update all parsing in tests to explicit BigDecimal type
diff --git a/src/arithmetic/cbrt.rs b/src/arithmetic/cbrt.rs index beb6e51..62fd851 100644 --- a/src/arithmetic/cbrt.rs +++ b/src/arithmetic/cbrt.rs @@ -123,7 +123,7 @@ mod test { let n: BigDecimal = $input.parse().unwrap(); let value = n.cbrt(); - let expected = $expe...
11
68
57
ed1f8a9151967ee8b5b7616e50898cbf6f03a1ab
Andrew Kubera
2025-11-13T02:43:57
Implement comparison with primitive integers
diff --git a/src/impl_cmp.rs b/src/impl_cmp.rs index a733f67..b75697d 100644 --- a/src/impl_cmp.rs +++ b/src/impl_cmp.rs @@ -345,6 +345,62 @@ fn highest_bit_lessthan_scaled(a: &BigUint, b: &BigUint, scale: u64) -> bool { } } +macro_rules! impl_prim_cmp { + ($t:ty) => { + impl PartialOrd<$t> for BigDec...
1
66
0
81a0ecf6133b482f949efb25727b4bc4f9e772b4
Andrew Kubera
2025-11-13T05:06:02
Move impl_ops_div tests to lib.tests.ops.div.rs
diff --git a/src/impl_ops_div.rs b/src/impl_ops_div.rs index d9fe25b..560fb3b 100644 --- a/src/impl_ops_div.rs +++ b/src/impl_ops_div.rs @@ -87,81 +87,4 @@ impl Div<&BigDecimal> for &BigDecimal { } } - -#[cfg(test)] -mod test { - use super::*; - - macro_rules! impl_case { - ($name:ident: $numerator...
2
78
78
b89be392fc69f86a0422ee595ecd0eaa444d13e4
Andrew Kubera
2025-11-05T23:43:42
Use is_one_quickcheck as optimization in `impl Div`
diff --git a/src/impl_ops_div.rs b/src/impl_ops_div.rs index 760c00c..d9fe25b 100644 --- a/src/impl_ops_div.rs +++ b/src/impl_ops_div.rs @@ -9,7 +9,7 @@ impl Div<BigDecimal> for BigDecimal { if other.is_zero() { panic!("Division by zero"); } - if self.is_zero() || other.is_one() { ...
1
3
3
8260ea82e64ce9876b1ca75ee4306f3cc2dd2b1e
Andrew Kubera
2025-11-05T23:37:28
Reimplement test_div with macros
diff --git a/src/impl_ops_div.rs b/src/impl_ops_div.rs index 99aef24..760c00c 100644 --- a/src/impl_ops_div.rs +++ b/src/impl_ops_div.rs @@ -92,54 +92,53 @@ impl Div<&BigDecimal> for &BigDecimal { mod test { use super::*; - #[test] - fn test_div() { - let vals = vec![ - ("0", "1", "0"), ...
1
45
46
ea59874c6285e1850c306f283f7628e774463e1e
Andrew Kubera
2025-11-13T01:16:19
Add tests for division by floating-point
diff --git a/src/lib.rs b/src/lib.rs index ad38b4b..6752379 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2362,6 +2362,11 @@ mod bigdecimal_tests { } include!("lib.tests.rs"); + + mod ops { + use super::*; + include!("lib.tests.ops.div.rs"); + } } diff --git a/src/lib.tests.ops.div.r...
2
100
0
ee9eead839428b8e2d963325bfe07c14a5990564
Georg Semmler
2025-11-11T12:47:40
Remove dev scripts from published package During a dependency review we noticed that the bigdecimal crate contains dev scripts that are not required for compiling the crate as dependency. To reduce the potential surface for executing malicous scripts its better to just exclude such scripts from the published package.
diff --git a/Cargo.toml b/Cargo.toml index 77e58a3..683d38f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,13 @@ categories = [ "mathematics", "science", "no-std" ] license = "MIT/Apache-2.0" autobenches = false edition = "2015" +include = [ + "LICENSE-APACHE", + "LICENSE-MIT", + "README.md", + "build.rs"...
1
7
0
028dfeeeb8da39dffc7028c39314377f37bbc5ee
Andrew Kubera
2025-11-13T00:19:43
Allow leading zeros in alignment tests
diff --git a/src/bigdigit/alignment.rs b/src/bigdigit/alignment.rs index 6c215c6..729148c 100644 --- a/src/bigdigit/alignment.rs +++ b/src/bigdigit/alignment.rs @@ -487,6 +487,7 @@ pub(crate) struct WithIntCount<T> { } #[cfg(test)] +#[allow(clippy::zero_prefixed_literal)] mod test { use super::*;
1
1
0
2838f780a9145ad1cba87ff40b06b2ad0831c237
Andrew Kubera
2025-10-20T00:16:42
Handle case where float approximation is subnormal
diff --git a/src/arithmetic/inverse.rs b/src/arithmetic/inverse.rs index 78be4be..738777b 100644 --- a/src/arithmetic/inverse.rs +++ b/src/arithmetic/inverse.rs @@ -23,8 +23,9 @@ pub(crate) fn impl_inverse_uint_scale(n: &BigUint, scale: i64, ctx: &Context) -> // use f64 approximation to guess initial inverse ...
1
15
1
553ef4b050461333d4d42246387d9c1e01b549b8
Andrew Kubera
2025-10-19T18:53:39
Remove unused proptest function
diff --git a/src/arithmetic/decimal.tests.rs b/src/arithmetic/decimal.tests.rs index dd7589b..cf44f3f 100644 --- a/src/arithmetic/decimal.tests.rs +++ b/src/arithmetic/decimal.tests.rs @@ -102,10 +102,6 @@ mod prop { use proptest::*; use proptest::num::f64::*; - fn random_f64() -> Any { - NORMAL |...
1
0
4
8acf87a041e74f7a6c4634a4f2c9a1de20065548
Andrew Kubera
2025-10-19T18:15:27
Begin v0.4.10 development
diff --git a/Cargo.lock b/Cargo.lock index 5206d66..ac44185 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,7 +8,7 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "bigdecimal" -version = "0.4.9" +version = "0.4.10+dev" dependencies = [ "autocfg", "libm", diff ...
2
2
2
deff05952c735fe6fb84244f6ac74bc296ced8d9
Andrew Kubera
2025-10-19T17:40:57
Version 0.4.9
diff --git a/Cargo.lock b/Cargo.lock index 010a4cd..5206d66 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,7 +8,7 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "bigdecimal" -version = "0.4.9+dev" +version = "0.4.9" dependencies = [ "autocfg", "libm", diff -...
2
2
2
bdab3a7f232b955b7e21663b54cdaee71bce2cb7
Andrew Kubera
2025-10-19T17:30:09
Remove blanket allow(dead_code) annotations
diff --git a/src/arithmetic/decimal.rs b/src/arithmetic/decimal.rs index 12f9bc5..9971b00 100644 --- a/src/arithmetic/decimal.rs +++ b/src/arithmetic/decimal.rs @@ -3,10 +3,10 @@ //! Note: Many bit-optimizations don't apply when doing decimal //! math, as high-order bits affect low-order decimals //! -#![allow...
10
22
4
9694c91ffe3d449bd1a9039692296a8320534def
Andrew Kubera
2025-10-19T15:47:35
Add more pow test cases
diff --git a/src/arithmetic/pow.tests.rs b/src/arithmetic/pow.tests.rs index bf443de..1285b67 100644 --- a/src/arithmetic/pow.tests.rs +++ b/src/arithmetic/pow.tests.rs @@ -5,11 +5,11 @@ mod powi_with_context { use super::*; macro_rules! impl_cases { - ( pow= - $pow:literal : $( prec=$prec:literal, r...
1
54
4
a69eabe399421c0cc939aec31add55db61a9e761
Andrew Kubera
2025-10-19T15:36:48
Clear `tmp` vector after use in DigitVec::from_biguint_using_tmp
diff --git a/src/arithmetic/pow.rs b/src/arithmetic/pow.rs index 65efd00..63a2107 100644 --- a/src/arithmetic/pow.rs +++ b/src/arithmetic/pow.rs @@ -82,6 +82,7 @@ fn pow_u64_with_context( let mut tmp = Vec::new(); let bd_as_base10p19 = DigitVec::from_biguint_using_tmp(bd.digits, &mut tmp); + debug_assert...
2
6
2
a1237bd7e661542c65549587326dc0edba39f5e0
Andrew Kubera
2025-10-19T14:32:14
Invert before calling pow_u64
diff --git a/src/arithmetic/pow.rs b/src/arithmetic/pow.rs index 17dc835..65efd00 100644 --- a/src/arithmetic/pow.rs +++ b/src/arithmetic/pow.rs @@ -43,9 +43,15 @@ fn powi_with_context( if exp == -1 { return bd.inverse_with_context(&ctx); } - let wide_prec = NonZero...
1
9
3
372c09479668cefc750f11dcacbd1c9071ffc3fb
Andrew Kubera
2025-10-19T14:31:49
Add new_truncating constructor for Context
diff --git a/src/context.rs b/src/context.rs index 549ac07..2a33f23 100644 --- a/src/context.rs +++ b/src/context.rs @@ -69,6 +69,15 @@ impl Context { } } + /// Rounding mode 'Down' for truncating results when + /// proper rounding is not necessary + pub(crate) fn new_truncating(prec: u64) -> S...
1
9
0
f9e8435b9c10f0f724f126b299845806c209dad3
Andrew Kubera
2025-10-19T02:14:07
Split BigDecimalRef conversions into separate function for multiply_decimal_with_context
diff --git a/src/arithmetic/multiplication.rs b/src/arithmetic/multiplication.rs index 973cf59..08c142a 100644 --- a/src/arithmetic/multiplication.rs +++ b/src/arithmetic/multiplication.rs @@ -41,6 +41,15 @@ pub(crate) fn multiply_decimals_with_context<'a, A, B>( let a = a.into(); let b = b.into(); + imp...
1
9
0
555c6f31e3ca6ce30d65430cdc6dc6beda90d4d1
Andrew Kubera
2025-10-18T23:30:52
Add function get_power_of_ten_u64 to arithmetic::decimal
diff --git a/src/arithmetic/decimal.rs b/src/arithmetic/decimal.rs index b97df35..12f9bc5 100644 --- a/src/arithmetic/decimal.rs +++ b/src/arithmetic/decimal.rs @@ -209,6 +209,31 @@ pub(crate) fn count_digits_biguint(n: &num_bigint::BigUint) -> u64 { digits } +/// Return Some(exp) if n == 10^{exp}, otherwise No...
1
25
0
d22acea4feea595fd26556949fdd09757ca14846
Andrew Kubera
2025-10-18T23:09:13
Improve inverse function with better initial guess and small-power-of-ten optimization
diff --git a/src/arithmetic/inverse.rs b/src/arithmetic/inverse.rs index 3e46dc2..78be4be 100644 --- a/src/arithmetic/inverse.rs +++ b/src/arithmetic/inverse.rs @@ -2,10 +2,35 @@ use crate::*; use super::exp2; +use arithmetic::decimal::get_power_of_ten_u64; /// Implementation of inverse: (1/n) pub(crate) fn imp...
2
109
2
2437295d4372c939bca0cbff9964e43892243e7b
Andrew Kubera
2025-10-18T16:30:20
Add a pow implementation without precision/rounding
diff --git a/src/arithmetic/pow.rs b/src/arithmetic/pow.rs index 589136f..17dc835 100644 --- a/src/arithmetic/pow.rs +++ b/src/arithmetic/pow.rs @@ -69,6 +69,11 @@ fn pow_u64_with_context( return ctx.round_decimal_ref(bd); } + // bd^exp guaranteed to fit within precision: use roundless pow + if (b...
1
40
0
9bab663dced94d17b5c3f68030c21a767d479353
Andrew Kubera
2025-10-18T15:17:26
Improve calculation of running-margin in pow() implementation
diff --git a/build.rs b/build.rs index b021073..09a9e32 100644 --- a/build.rs +++ b/build.rs @@ -25,6 +25,9 @@ fn main() { // Option::zip ac.emit_rustc_version(1, 46); + // int::unsigned_abs (1.51) + ac.emit_expression_cfg("0i64.unsigned_abs()", "has_unsigned_abs"); + // Remove this comment if en...
2
190
64
c0aa91cf02d0107da743a6cca4e824c38c6940a7
Andrew Kubera
2025-10-12T21:54:11
Improve documentation
diff --git a/src/context.rs b/src/context.rs index 3c1395f..549ac07 100644 --- a/src/context.rs +++ b/src/context.rs @@ -128,18 +128,20 @@ impl Context { self.rounding.round_pair_with_carry(sign, (x, y), trailing_zeros, carry) } - /// Multiply two decimals, returning product rounded to this context's...
1
19
6
6136808ede9d5eafd571a4a1968c0bf4aba4ab09
Andrew Kubera
2025-10-12T21:45:12
Add method least_n_are_zero to DigitVec and DigitSlice
diff --git a/src/arithmetic/multiplication.rs b/src/arithmetic/multiplication.rs index 6cbddf9..973cf59 100644 --- a/src/arithmetic/multiplication.rs +++ b/src/arithmetic/multiplication.rs @@ -590,9 +590,9 @@ fn calculate_partial_product_trailing_zeros( let top_insig = v.digits[top_insig_idx]; if top_...
3
16
6
6bbbb2f8a9060820106f0ca5e642499a75a52846
Andrew Kubera
2025-10-12T20:06:08
Fix missing calculation of trailing zeros
diff --git a/src/arithmetic/multiplication.rs b/src/arithmetic/multiplication.rs index c0396aa..6cbddf9 100644 --- a/src/arithmetic/multiplication.rs +++ b/src/arithmetic/multiplication.rs @@ -482,7 +482,7 @@ fn calculate_partial_product_trailing_zeros( let trailing_zeros; let trailing_nines; - // index ...
1
5
3
f36a520c6458bc047fbf85c37cb7defa29510cca
Andrew Kubera
2025-10-12T01:58:06
Add more powi tests
diff --git a/src/arithmetic/pow.tests.rs b/src/arithmetic/pow.tests.rs index e6b7e0f..bf443de 100644 --- a/src/arithmetic/pow.tests.rs +++ b/src/arithmetic/pow.tests.rs @@ -1,3 +1,133 @@ +use paste::paste; + +#[allow(non_snake_case)] +mod powi_with_context { + use super::*; + + macro_rules! impl_cases { + ...
1
130
0
0f8028f305068c46eac3864a017d412a7b9ccb00
Andrew Kubera
2025-10-06T02:47:23
Reimplement powi using DigitVec & DigitSlice
diff --git a/src/arithmetic/pow.rs b/src/arithmetic/pow.rs index 66bd8e7..2db6b25 100644 --- a/src/arithmetic/pow.rs +++ b/src/arithmetic/pow.rs @@ -4,15 +4,37 @@ use stdlib::num::NonZeroU64; use crate::*; +use super::log10; +use super::multiplication::{ + multiply_decimals_with_context, + multiply_slices_wi...
2
126
28
258c14ef7c4e1fb713a25c542ebbbece33a36115
Andrew Kubera
2025-10-12T18:00:27
Add inverse methods to Context
diff --git a/src/context.rs b/src/context.rs index 2eb230a..3c1395f 100644 --- a/src/context.rs +++ b/src/context.rs @@ -153,6 +153,14 @@ impl Context { multiply_decimals_with_context(&mut result, lhs, rhs, self); result } + + /// Calculate 1/n + /// + /// If n=zero, return zero + ///...
2
28
9
381bb17a7eb14fcff0ef58738d6afcaedcc3e510
Andrew Kubera
2025-10-11T22:11:26
Return number of skipped bigdigits in mul_scaled_slices_truncating_into
diff --git a/src/arithmetic/multiplication.rs b/src/arithmetic/multiplication.rs index 3f33004..c0396aa 100644 --- a/src/arithmetic/multiplication.rs +++ b/src/arithmetic/multiplication.rs @@ -608,12 +608,15 @@ fn calculate_partial_product_trailing_zeros( /// /// The scale of these vector/slices is number of *bigdigi...
1
7
2
de1ccb32f41063a4b3883687f8bc40478819d592
Andrew Kubera
2025-10-12T16:57:07
Rename pow -> powi
diff --git a/src/arithmetic/pow.rs b/src/arithmetic/pow.rs index ac1c4c7..66bd8e7 100644 --- a/src/arithmetic/pow.rs +++ b/src/arithmetic/pow.rs @@ -8,7 +8,7 @@ use crate::*; /// precision specified in ctx (the number of digits would otherwise explode). /// /// Algorithm comes from https://en.wikipedia.org/wiki/Expo...
3
9
9
b5825f3560a25b71cc47c3ecf6cc5eb223371af1
Andrew Kubera
2025-10-12T16:41:06
Move pow tests into src/arithmetic/pow.tests.rs
diff --git a/src/arithmetic/pow.rs b/src/arithmetic/pow.rs index 969f481..ac1c4c7 100644 --- a/src/arithmetic/pow.rs +++ b/src/arithmetic/pow.rs @@ -66,92 +66,6 @@ pub(crate) fn impl_pow_with_context(bd: &BigDecimal, exp: i64, ctx: &Context) -> #[cfg(test)] mod test { use super::*; - use stdlib::num::NonZeroU...
2
87
87
8e17cd4f9a8a0262c8f8fec6a7c5ccb049f6566f
Nicolas Boichat
2025-10-12T16:32:19
Implement pow/pow_with_context (exponentiation with integer parameter) (#148) * pow: Add pow/pow_with_context function Add a function to raise a BigDecimal to an integer power. The number of digits would blow up if we kept the exact value, so we use the precision provided in Context parameter (or the default value)....
diff --git a/src/arithmetic/mod.rs b/src/arithmetic/mod.rs index 1f593a2..aa2151c 100644 --- a/src/arithmetic/mod.rs +++ b/src/arithmetic/mod.rs @@ -12,6 +12,7 @@ pub(crate) mod modulo; pub(crate) mod sqrt; pub(crate) mod cbrt; pub(crate) mod inverse; +pub(crate) mod pow; pub(crate) use self::decimal::{ coun...
3
184
0
38da064500fb96fcf7e5412bcc36e6b3ae4666e0
Andrew Kubera
2025-10-11T19:29:32
Add more test cases for multiply_scaled_u64_slices_with_prec_into
diff --git a/src/arithmetic/multiplication.tests.rs b/src/arithmetic/multiplication.tests.rs index 216340b..d591340 100644 --- a/src/arithmetic/multiplication.tests.rs +++ b/src/arithmetic/multiplication.tests.rs @@ -4,75 +4,144 @@ mod multiply_scaled_u64_slices_with_prec_into { use super::*; macro_rules! i...
1
128
57
b507e25b4115122bc2769f4934553df449b9ca0b
Andrew Kubera
2025-10-11T17:03:34
Add method WithScale<DigitVec>::as_sdigit_slice
diff --git a/src/bigdigit/digitvec.rs b/src/bigdigit/digitvec.rs index b58a4b2..b205e44 100644 --- a/src/bigdigit/digitvec.rs +++ b/src/bigdigit/digitvec.rs @@ -906,3 +906,13 @@ impl<R: RadixType, E: Endianness> fmt::Debug for DigitSliceMut<'_, R, E> { write!(f, "DigitSliceMut({}, {:?})", E::NAME, self.digits)...
1
10
0
ea8f5c9b53e28871928615a7a72e828e6f676bb9
Andrew Kubera
2025-10-09T02:12:03
Add optimization when multiplying by ±1
diff --git a/src/arithmetic/multiplication.rs b/src/arithmetic/multiplication.rs index 1afe841..3f33004 100644 --- a/src/arithmetic/multiplication.rs +++ b/src/arithmetic/multiplication.rs @@ -55,6 +55,20 @@ pub(crate) fn multiply_decimals_with_context<'a, A, B>( let a_uint = a.digits; let b_uint = b.digits; ...
1
14
0
9b94ebb20fec3f3bd46e9fc55457c23fde138457
Andrew Kubera
2025-10-09T02:07:53
Move round_biguint_to_prec into NonDigitRoundingData
diff --git a/src/context.rs b/src/context.rs index d6afff1..2eb230a 100644 --- a/src/context.rs +++ b/src/context.rs @@ -5,6 +5,7 @@ use crate::*; use stdlib::num::NonZeroU64; use arithmetic::store_carry; +use rounding::NonDigitRoundingData; // const DEFAULT_PRECISION: u64 = ${RUST_BIGDECIMAL_DEFAULT_PRECISION...
2
16
11