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

Commit 3870633

Browse files
committed
Add rounding mode test
1 parent 3ad356d commit 3870633

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

crates/core_simd/tests/ops_impl/float_macros.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,15 @@ macro_rules! float_tests {
362362
}
363363
}
364364

365+
#[test]
366+
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
367+
fn round_mode() {
368+
assert_biteq!(core_simd::$vector::splat(1.5).round(), core_simd::$vector::splat(2.0));
369+
assert_biteq!(core_simd::$vector::splat(2.5).round(), core_simd::$vector::splat(3.0));
370+
assert_biteq!(core_simd::$vector::splat(-1.5).round(), core_simd::$vector::splat(-2.0));
371+
assert_biteq!(core_simd::$vector::splat(-2.5).round(), core_simd::$vector::splat(-3.0));
372+
}
373+
365374
#[test]
366375
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
367376
fn trunc_odd_floats() {

0 commit comments

Comments
 (0)