Skip to content

Commit

Permalink
Merge pull request #919 from jjerphan/docs/basic-usage-fixes
Browse files Browse the repository at this point in the history
docs: Fixes "Basic Usage" section examples
  • Loading branch information
JohanMabille committed Apr 11, 2023
2 parents a1e0751 + 250ef60 commit 71c7fc4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/source/basic_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ architecture available, based on compile time informations:
namespace xs = xsimd;
xs::batch<float> mean(xs::batch<float> lhs, xs::batch<float> rhs) {
return lhs + rhs / 2;
return (lhs + rhs) / 2;
}
The batch can be a batch of 4 single precision floating point numbers (e.g. on
Expand All @@ -38,8 +38,8 @@ example:
namespace xs = xsimd;
template<class T, class Arch>
xs::batch<T, A> mean(xs::batch<T, A> lhs, xs::batch<T, A> rhs) {
return lhs + rhs / 2;
xs::batch<T, Arch> mean(xs::batch<T, Arch> lhs, xs::batch<T, Arch> rhs) {
return (lhs + rhs) / 2;
}
At its core, a :cpp:class:`xsimd::batch` is bound to the scalar type it contains, and to the
Expand Down

0 comments on commit 71c7fc4

Please sign in to comment.