Coverage Report

Created: 2026-09-14 07:01

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/sofars-0.6.1/src/vm/tf2a.rs
Line
Count
Source
1
use crate::consts::DS2R;
2
3
/// Convert hours, minutes, seconds to radians.
4
#[inline]
5
0
pub fn tf2a(s: char, ihour: i32, imin: i32, sec: f64) -> Result<f64, i32> {
6
    /* Compute the interval. */
7
0
    let rad = (match s {
8
0
        '-' => -1.0,
9
0
        _ => 1.0,
10
0
    }) * (60.0 * (60.0 * ihour.abs() as f64 + imin.abs() as f64) + sec.abs())
11
        * DS2R;
12
13
    /* Validate arguments and return status. */
14
0
    if ihour < 0 || ihour > 23 {
15
0
        return Err(1);
16
0
    }
17
0
    if imin < 0 || imin > 59 {
18
0
        return Err(2);
19
0
    }
20
0
    if sec < 0.0 || sec >= 60.0 {
21
0
        return Err(3);
22
0
    }
23
24
0
    Ok(rad)
25
0
}