MCPcopy Create free account
hub / github.com/OpenNMT/CTranslate2 / copysign

Function copysign

include/half_float/half.hpp:4342–4342  ·  view source on GitHub ↗

Take sign. See also:** Documentation for [std::copysign](https://en.cppreference.com/w/cpp/numeric/math/copysign). \param x value to change sign for \param y value to take sign from \return value equal to \a x in magnitude and to \a y in sign

Source from the content-addressed store, hash-verified

4340 /// \param y value to take sign from
4341 /// \return value equal to \a x in magnitude and to \a y in sign
4342 inline HALF_CONSTEXPR half copysign(half x, half y) { return half(detail::binary, x.data_^((x.data_^y.data_)&0x8000)); }
4343
4344 /// \}
4345 /// \anchor classification

Callers

nothing calls this directly

Calls 1

halfClass · 0.85

Tested by

no test coverage detected