rust-bitcoin-unsafe-fast/units
Andrew Poelstra bf29a76d89
Merge rust-bitcoin/rust-bitcoin#2436: Add unchecked variants to Amount and SignedAmount
df1d2f6eb5 Add unchecked variants to Amount and SignedAmount (yancy)

Pull request description:

  The checked variants have worse performance than the unchecked variants due to the additional branching operations.  To improve performance where overflow is either not possible or not a concern, unchecked variants of `Amount` and `SignedAmount` are introduced for addition, subtraction and multiplication.

  Note, it seems the default behavior for the test framework is to panic on overflow, so I haven't figured out a good way to add tests for this.  Marking as a draft for now.

  closes: https://github.com/rust-bitcoin/rust-bitcoin/issues/2434

ACKs for top commit:
  Kixunil:
    ACK df1d2f6eb5
  apoelstra:
    ACK df1d2f6eb5 gonna go ahead and merge this, we can revisit if necessary when we look at `units` overflow behavior in general

Tree-SHA512: 3fbb0ec81a758b350569226c44e25f6ca49e551566bee83c05c1c2b343874ef657d63a36b5f51c41582d8a8e36466275c574ebff6d363ed7c112ac8b4d5376fa
2024-02-15 15:04:28 +00:00
..
contrib CI: Epic overhaul 2024-02-02 05:57:23 +11:00
src Merge rust-bitcoin/rust-bitcoin#2436: Add unchecked variants to Amount and SignedAmount 2024-02-15 15:04:28 +00:00
Cargo.toml Use InputString instead of String 2023-12-11 08:53:13 +11:00
README.md Add bitcoin-units crate 2023-12-11 08:52:31 +11:00

README.md

Bitcoin Units

This crate provides basic Bitcoin numeric units such as Amount.

Minimum Supported Rust Version (MSRV)

This library should always compile with any combination of features on Rust 1.56.1.

Licensing

The code in this project is licensed under the Creative Commons CC0 1.0 Universal license. We use the SPDX license list and SPDX IDs.