commit cedde97fd9aff8563e3e9e3dc2b66f141ac03ef7
parent 3e1f493e52743d2f6d3c2d8216cefc1f41a175f2
Author: d.levin256@gmail.com <d.levin256@gmail.com>
Date: Wed, 10 Aug 2016 03:58:47 +0300
Fix sqrt returning zero instead of nan
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/kfr/base/sqrt.hpp b/include/kfr/base/sqrt.hpp
@@ -53,7 +53,7 @@ KFR_HANDLE_ALL_SIZES_FLT_1(sqrt)
template <typename T, size_t N, typename Tout = flt_type<T>>
KFR_SINTRIN vec<Tout, N> sqrt(const vec<T, N>& x)
{
- return apply([](T x) { return std::sqrt(static_cast<Tout>(x)); }, x);
+ return apply([](Tout x) { return std::sqrt(x); }, cast<Tout>(x));
}
#endif
KFR_I_CONVERTER(sqrt)