MCPcopy Create free account
hub / github.com/apache/datafusion / test_cot_scalar_zero

Function test_cot_scalar_zero

datafusion/functions/src/math/cot.rs:311–331  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

309
310 #[test]
311 fn test_cot_scalar_zero() {
312 let arg_fields = vec![Field::new("a", DataType::Float64, false).into()];
313 let args = ScalarFunctionArgs {
314 args: vec![ColumnarValue::Scalar(ScalarValue::Float64(Some(0.0)))],
315 arg_fields,
316 number_rows: 1,
317 return_field: Field::new("f", DataType::Float64, false).into(),
318 config_options: Arc::new(ConfigOptions::default()),
319 };
320 let result = CotFunc::new()
321 .invoke_with_args(args)
322 .expect("cot zero should succeed");
323
324 match result {
325 ColumnarValue::Scalar(ScalarValue::Float64(Some(v))) => {
326 // cot(0) = 1/tan(0) = infinity
327 assert!(v.is_infinite());
328 }
329 _ => panic!("Expected Float64 scalar"),
330 }
331 }
332
333 #[test]
334 fn test_cot_scalar_pi() {

Callers

nothing calls this directly

Calls 3

newFunction · 0.85
intoMethod · 0.45
invoke_with_argsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…