MCPcopy Create free account
hub / github.com/apache/singa / sign_mask

Function sign_mask

include/half.hpp:591–599  ·  view source on GitHub ↗

Platform-independent sign mask. \param arg integer value in two's complement \retval -1 if \a arg negative \retval 0 if \a arg positive

Source from the content-addressed store, hash-verified

589 /// \retval -1 if \a arg negative
590 /// \retval 0 if \a arg positive
591 inline uint32 sign_mask(uint32 arg)
592 {
593 static const int N = std::numeric_limits<uint32>::digits - 1;
594 #if HALF_TWOS_COMPLEMENT_INT
595 return static_cast<int32>(arg) >> N;
596 #else
597 return -((arg>>N)&1);
598 #endif
599 }
600
601 /// Platform-independent arithmetic right shift.
602 /// \param arg integer value in two's complement

Callers 8

fixed2halfFunction · 0.85
sincosFunction · 0.85
atan2Function · 0.85
log2_postFunction · 0.85
log2Function · 0.85
cbrtFunction · 0.85
powFunction · 0.85
tanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected