|
7 | 7 | std::ops::Neg, |
8 | 8 | }; |
9 | 9 |
|
10 | | -#[cfg(any(feature = "num-integer-backend", target_family = "wasm", windows))] |
| 10 | +#[cfg(any( |
| 11 | + feature = "num-integer-backend", |
| 12 | + target_family = "wasm", |
| 13 | + target_env = "musl", |
| 14 | + windows |
| 15 | +))] |
11 | 16 | /// Checks that ev is successful in the lottery. In particular, it compares the output of `phi` |
12 | 17 | /// (a real) to the output of `ev` (a hash). It uses the same technique used in the |
13 | 18 | /// [Cardano ledger](https://github.com/input-output-hk/cardano-ledger/). In particular, |
@@ -49,7 +54,12 @@ pub(crate) fn is_lottery_won(phi_f: f64, ev: [u8; 64], stake: Stake, total_stake |
49 | 54 | taylor_comparison(1000, q, x) |
50 | 55 | } |
51 | 56 |
|
52 | | -#[cfg(any(feature = "num-integer-backend", target_family = "wasm", windows))] |
| 57 | +#[cfg(any( |
| 58 | + feature = "num-integer-backend", |
| 59 | + target_family = "wasm", |
| 60 | + target_env = "musl", |
| 61 | + windows |
| 62 | +))] |
53 | 63 | /// Checks if cmp < exp(x). Uses error approximation for an early stop. Whenever the value being |
54 | 64 | /// compared, `cmp`, is smaller (or greater) than the current approximation minus an `error_term` |
55 | 65 | /// (plus an `error_term` respectively), then we stop approximating. The choice of the `error_term` |
@@ -82,7 +92,12 @@ fn taylor_comparison(bound: usize, cmp: Ratio<BigInt>, x: Ratio<BigInt>) -> bool |
82 | 92 | false |
83 | 93 | } |
84 | 94 |
|
85 | | -#[cfg(not(any(feature = "num-integer-backend", target_family = "wasm", windows)))] |
| 95 | +#[cfg(not(any( |
| 96 | + feature = "num-integer-backend", |
| 97 | + target_family = "wasm", |
| 98 | + target_env = "musl", |
| 99 | + windows |
| 100 | +)))] |
86 | 101 | /// The crate `rug` has sufficient optimizations to not require a taylor approximation with early |
87 | 102 | /// stop. The difference between the current implementation and the one using the optimization |
88 | 103 | /// above is around 10% faster. We perform the computations with 117 significant bits of |
|
0 commit comments