Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit bb75cc3

Browse files
committed
BRANCH TBD enable exhaustive tests for scalbn and ldexp
Combine the PR for exhaustive tests and for scalbn/ldexp tests. Needs to apply to whichever branch merges later.
1 parent c969ddd commit bb75cc3

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

crates/libm-test/src/gen/extensive.rs

+20
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,26 @@ macro_rules! impl_extensive_input {
115115
KnownSize::new(iter, count)
116116
}
117117
}
118+
119+
impl<Op> ExtensiveInput<Op> for ($fty, i32)
120+
where
121+
Op: MathOp<RustArgs = Self, FTy = $fty>,
122+
{
123+
fn get_cases(ctx: &CheckCtx) -> impl ExactSizeIterator<Item = Self> {
124+
let start = <$fty>::NEG_INFINITY;
125+
let end = <$fty>::INFINITY;
126+
127+
let (iter0, steps0) = logspace_steps::<Op>(start, end, ctx, 1);
128+
let iter1 = int_range(ctx, GeneratorKind::Extensive, 0);
129+
let steps1 = iteration_count(ctx, GeneratorKind::Extensive, 0);
130+
131+
let iter =
132+
iter0.flat_map(move |first| iter1.clone().map(move |second| (first, second)));
133+
let count = steps0.checked_mul(steps1).unwrap();
134+
135+
KnownSize::new(iter, count)
136+
}
137+
}
118138
};
119139
}
120140

crates/libm-test/tests/z_extensive/run.rs

-4
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,10 @@ fn register_all_tests() -> Vec<Trial> {
5353
frexpf,
5454
ilogb,
5555
ilogbf,
56-
ldexp,
57-
ldexpf,
5856
modf,
5957
modff,
6058
remquo,
6159
remquof,
62-
scalbn,
63-
scalbnf,
6460

6561
// FIXME: test needed, see
6662
// https://github.com/rust-lang/libm/pull/311#discussion_r1818273392

0 commit comments

Comments
 (0)