Skip to content

Commit f60f43a

Browse files
committed
Add documentation for clamp function
1 parent fdda86b commit f60f43a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/arith/mod.rs

+22
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ macro_rules! overloaded_binary_func {
256256
///# Return Values
257257
///
258258
/// An Array with results of the binary operation.
259+
///
260+
///# Note
261+
///
262+
/// The trait `Convertable` essentially translates to a scalar native type on rust or Array.
259263
pub fn $fn_name<T, U> (arg1: &T, arg2: &U, batch: bool) -> Array where T: Convertable, U: Convertable {
260264
let lhs = arg1.convert();
261265
let rhs = arg2.convert();
@@ -294,6 +298,24 @@ overloaded_binary_func!("Create complex array from two Arrays", cplx2, cplx2_hel
294298
overloaded_binary_func!("Compute root", root, root_helper, af_root);
295299
overloaded_binary_func!("Computer power", pow, pow_helper, af_pow);
296300

301+
/// Clamp the values of Array
302+
///
303+
/// # Parameters
304+
///
305+
/// - `arg1`is an argument that implements an internal trait `Convertable`.
306+
/// - `arg2`is an argument that implements an internal trait `Convertable`.
307+
/// - `batch` is an boolean that indicates if the current operation is an batch operation.
308+
///
309+
/// Both parameters `arg1` and `arg2` can be either an Array or a value of rust integral
310+
/// type.
311+
///
312+
/// # Return Values
313+
///
314+
/// An Array with results of the binary operation.
315+
///
316+
/// # Note
317+
///
318+
/// The trait `Convertable` essentially translates to a scalar native type on rust or Array.
297319
pub fn clamp<T, U> (input: &Array, arg1: &T, arg2: &U, batch: bool) -> Array
298320
where T: Convertable, U: Convertable
299321
{

0 commit comments

Comments
 (0)