xsimd icon indicating copy to clipboard operation
xsimd copied to clipboard

Math functions for integral batches

Open JohanMabille opened this issue 3 years ago • 2 comments

A lot of mathematical functions from the STL convert their argument for integer to double and then rely on the overload for double (remainder, nearbyint, etc...).

xsimd should follow the same pattern when no equivalent more optimized implementation is possible. Generic functions for converting subset of integral batches to double batches should be added as part of the public API.

JohanMabille avatar Nov 23 '20 09:11 JohanMabille

@JohanMabille do you think we should make that conversion implicit? We already have enough functions to allow users to do the conversion explicitly...

serge-sans-paille avatar Mar 11 '23 21:03 serge-sans-paille

do you think we should make that conversion implicit?

Actually no; the C++ runtime provides implicit conversions between builtin types for convenience, but these are usually source of warnings that lead to replace them with explicit conversions; so let's do it the right way and not provide implicit conversions.

However, I still think we should provide overloads of math functions for integral batches at some point.

JohanMabille avatar Mar 14 '23 16:03 JohanMabille