You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Output of example in ReadMe file is not matching with the current master #2790
I was not questioning the output, but with xtensor handling multiple dtypes getting 1. on print would be ideal. Let's make sure that the example prints in the same way as well to avoid any confusions.
It's a small refactor, maybe I can send in my first PR ?
Update std::coutto use setprecision.
Use a floating point number which won't be truncated like 1.5 instead of 1.0.
Use xt::view(arr, 0, 0) for the indexing instead of arr(0, 0). This prints 1. as expected.
Activity
spectre-ns commentedon Jul 6, 2024
I suspect this is a rounding issue in std::cout if you use the following line it displays correctly:
This is not an xtensor issue. 1 or 1.0 are equal and that is the correct output.
faze-geek commentedon Jul 6, 2024
I was not questioning the output, but with xtensor handling multiple dtypes getting
1.on print would be ideal. Let's make sure that the example prints in the same way as well to avoid any confusions.It's a small refactor, maybe I can send in my first PR ?
std::coutto use setprecision.xt::view(arr, 0, 0)for the indexing instead ofarr(0, 0). This prints 1. as expected.