rust-bitcoin-unsafe-fast/bitcoin
Andrew Poelstra 37b02199e6
Merge rust-bitcoin/rust-bitcoin#1707: Add a method to `pow::Target` for returning difficulty as an f64.
2158f88f1d Add a method to `pow::Target` for returning difficulty as an f64. (junderw)

Pull request description:

  Closes #1703

  This adds a conversion function to U256 to get an f64. We use the method shown in the following blog post.

  https://blog.m-ou.se/floats/

  Target::MAX was converted to a f64 and set as a const that is verified in a unit test.

  The code is rather confusing, so I took a crack at explaining it in my comments as well. Please let me know if you want it cleaned up some more.

ACKs for top commit:
  apoelstra:
    ACK 2158f88f1d
  tcharding:
    ACK 2158f88f1d

Tree-SHA512: 7c0e82bd1756950c1c6dfb9da91fd71b276e2e7dc8a33e69112f87b87e358240f0f7c4894d24ab228e149d862938833a2e65e345ce2712a78dc86dec197da34f
2023-03-14 18:25:38 +00:00
..
contrib Fix CI builds where default features are added accidentally 2023-03-12 20:24:55 +00:00
embedded Instruct devs to use nightly for embedded 2023-02-03 08:44:47 +11:00
examples Run the formatter 2023-03-06 10:22:29 +11:00
fuzz Add a newtype for script-pushable slice 2023-02-18 16:35:25 +01:00
src Merge rust-bitcoin/rust-bitcoin#1707: Add a method to `pow::Target` for returning difficulty as an f64. 2023-03-14 18:25:38 +00:00
tests Run the formatter 2023-03-06 10:22:29 +11:00
CHANGELOG.md add some documentation clarifying the locktime ordering shenanigans in #1330 2022-12-15 23:12:03 +00:00
Cargo.toml bump bitcoin-hashes version to 0.12 2023-03-05 13:40:20 +00:00
build.rs Set rustv_1_53 in build script 2023-02-02 10:12:16 +11:00