(value: f64, other_int: &BigInt)
| 38 | } |
| 39 | |
| 40 | pub fn lt_int(value: f64, other_int: &BigInt) -> bool { |
| 41 | match (value.to_bigint(), other_int.to_f64()) { |
| 42 | (Some(self_int), Some(other_float)) => value < other_float || self_int < *other_int, |
| 43 | // finite float, other_int too big for float, |
| 44 | // the result depends only on other_int’s sign |
| 45 | (Some(_), None) => other_int.is_positive(), |
| 46 | // infinite float must be bigger or lower than any int, depending on its sign |
| 47 | _ if value.is_infinite() => value.is_sign_negative(), |
| 48 | // NaN, always false |
| 49 | _ => false, |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | pub fn gt_int(value: f64, other_int: &BigInt) -> bool { |
| 54 | match (value.to_bigint(), other_int.to_f64()) { |
no test coverage detected