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

Function numeric_abs

crates/gitql-std/src/number/mod.rs:163–170  ·  view source on GitHub ↗
(inputs: &[Box<dyn Value>])

Source from the content-addressed store, hash-verified

161}
162
163pub fn numeric_abs(inputs: &[Box<dyn Value>]) -> Box<dyn Value> {
164 let input_type = inputs[0].data_type();
165 if input_type.is_float() {
166 let value = inputs[0].as_float().unwrap().abs();
167 return Box::new(FloatValue::new(value));
168 }
169 Box::new(IntValue::new(inputs[0].as_int().unwrap().abs()))
170}
171
172pub fn numeric_pi(_inputs: &[Box<dyn Value>]) -> Box<dyn Value> {
173 let pi = std::f64::consts::PI;

Callers

nothing calls this directly

Calls 4

as_floatMethod · 0.80
as_intMethod · 0.80
data_typeMethod · 0.45
is_floatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…