MCPcopy Create free account
hub / github.com/AmrDeveloper/GQL / div

Method div

crates/gitql-ast/src/interval.rs:54–63  ·  view source on GitHub ↗
(&self, other: i64)

Source from the content-addressed store, hash-verified

52 }
53
54 pub fn div(&self, other: i64) -> Result<Interval, String> {
55 let mut result = self.clone();
56 result.years = interval_value_or_error_i64(result.years / other)?;
57 result.months = interval_value_or_error_i64(result.months / other)?;
58 result.days = interval_value_or_error_i64(result.days / other)?;
59 result.hours = interval_value_or_error_i64(result.hours / other)?;
60 result.minutes = interval_value_or_error_i64(result.minutes / other)?;
61 result.seconds = interval_value_or_error_f64(result.seconds.div(other as f64))?;
62 Ok(result)
63 }
64
65 pub fn to_seconds(&self) -> i64 {
66 let days =

Callers 1

div_opMethod · 0.80

Calls 2

Tested by

no test coverage detected