Coverage Report

Created: 2025-11-20 14:58

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/build/cargo-vendor-dir/libm-0.2.15/src/math/rint.rs
Line
Count
Source
1
use super::support::Round;
2
3
/// Round `x` to the nearest integer, breaking ties toward even.
4
#[cfg(f16_enabled)]
5
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
6
pub fn rintf16(x: f16) -> f16 {
7
    select_implementation! {
8
        name: rintf16,
9
        use_arch: all(target_arch = "aarch64", target_feature = "fp16"),
10
        args: x,
11
    }
12
13
    super::generic::rint_round(x, Round::Nearest).val
14
}
15
16
/// Round `x` to the nearest integer, breaking ties toward even.
17
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
18
189
pub fn rintf(x: f32) -> f32 {
19
189
    select_implementation! {
20
189
        name: rintf,
21
189
        use_arch: any(
22
189
            all(target_arch = "aarch64", target_feature = "neon"),
23
189
            all(target_arch = "wasm32", intrinsics_enabled),
24
189
        ),
25
189
        args: x,
26
189
    }
27
189
28
189
    super::generic::rint_round(x, Round::Nearest).val
29
189
}
30
31
/// Round `x` to the nearest integer, breaking ties toward even.
32
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
33
109
pub fn rint(x: f64) -> f64 {
34
109
    select_implementation! {
35
109
        name: rint,
36
109
        use_arch: any(
37
109
            all(target_arch = "aarch64", target_feature = "neon"),
38
109
            all(target_arch = "wasm32", intrinsics_enabled),
39
109
        ),
40
109
        args: x,
41
109
    }
42
109
43
109
    super::generic::rint_round(x, Round::Nearest).val
44
109
}
45
46
/// Round `x` to the nearest integer, breaking ties toward even.
47
#[cfg(f128_enabled)]
48
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
49
pub fn rintf128(x: f128) -> f128 {
50
    super::generic::rint_round(x, Round::Nearest).val
51
}