[SYCL] Change return type of frexp(float) to float - #23049
Conversation
db7ae52 to
57af465
Compare
|
Have you checked if any other return types are wrong in the wrapper header? This kind of issue is likely a result of a copy & paste error, so there might be other functions that are wrong. |
| #include <type_traits> | ||
|
|
||
| static_assert( | ||
| std::is_same_v<decltype(std::frexp(0.0f, (int *)nullptr)), float>); | ||
| static_assert( | ||
| std::is_same_v<decltype(std::frexpf(0.0f, (int *)nullptr)), float>); | ||
| static_assert( | ||
| std::is_same_v<decltype(std::frexp(0.0, (int *)nullptr)), double>); | ||
| static_assert(std::is_same_v<decltype(std::frexp(0, (int *)nullptr)), double>); |
There was a problem hiding this comment.
This is just my opinion, but I don't think testing like this makes much sense honestly.
There is no complicated type deduction going on in the declaration of frexp, reviewers can simply read the return type from the headers.
This kind of testing would maybe make sense if we checked that the return types of all cmath functions match what the C++ standard defines. That would have caught this regression.
There was a problem hiding this comment.
ok, I will just remove these checks since, as you wrote, they don't add much value here. About test for all cmatch functions - this should be a separate PR
57af465 to
9061c8e
Compare
yes, I checked the other functions, and there was only a problem with frexp |
Change return type of frexp(float) and add test with static assertions for frexp return types.
Fixes #23041