Skip to content

Commit 8a5f631

Browse files
committed
Rename prod -> product
1 parent aa9768e commit 8a5f631

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/numeric/impl_numeric.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ impl<A, S, D> ArrayBase<S, D>
6161
///
6262
/// let a = arr2(&[[1., 2.],
6363
/// [3., 4.]]);
64-
/// assert_eq!(a.prod(), 24.);
64+
/// assert_eq!(a.product(), 24.);
6565
/// ```
66-
pub fn prod(&self) -> A
66+
pub fn product(&self) -> A
6767
where A: Clone + Mul<Output=A> + libnum::One,
6868
{
6969
if let Some(slc) = self.as_slice_memory_order() {

tests/oper.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,9 @@ fn fold_and_sum() {
272272
}
273273

274274
#[test]
275-
fn prod() {
275+
fn product() {
276276
let a = Array::linspace(0.5, 2., 128).into_shape((8, 16)).unwrap();
277-
assert_approx_eq(a.fold(1., |acc, &x| acc * x), a.prod(), 1e-5);
277+
assert_approx_eq(a.fold(1., |acc, &x| acc * x), a.product(), 1e-5);
278278

279279
// test different strides
280280
let max = 8 as Ixs;
@@ -286,7 +286,7 @@ fn prod() {
286286
prod *= *elt;
287287
}
288288
assert_approx_eq(a1.fold(1., |acc, &x| acc * x), prod, 1e-5);
289-
assert_approx_eq(prod, a1.prod(), 1e-5);
289+
assert_approx_eq(prod, a1.product(), 1e-5);
290290
}
291291
}
292292
}

0 commit comments

Comments
 (0)