mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 00:51:35 +08:00
Partially removed all references to STL's algorithm. <algorithm> is not included anywhere, though still used in several places which still alows the code to compile as <algorithm> is being pulled in from some other standard headers.
This commit is contained in:
@@ -82,7 +82,7 @@ uint16_t IEEE754Converter::nativeNonIeeeToHalf(float value)
|
||||
hbits |= ((exp + 14) << 10);
|
||||
}
|
||||
const int32_t ival = static_cast<int32_t>(value);
|
||||
hbits |= static_cast<uint16_t>(std::abs(ival) & 0x3FFU);
|
||||
hbits |= static_cast<uint16_t>(((ival < 0) ? (-ival) : ival) & 0x3FFU);
|
||||
float diff = std::abs(value - static_cast<float>(ival));
|
||||
hbits += diff >= 0.5F;
|
||||
return hbits;
|
||||
|
||||
Reference in New Issue
Block a user