Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

#include <algorithm>
#include <array>
#include <cfenv>
#include <cmath>
#include <deque>
#include <string_view>
Expand Down Expand Up @@ -306,15 +305,11 @@ jni::local_ref<jstring> getPlatformComponentName(const ShadowView& shadowView) {
}

inline float scale(Float value, Float pointScaleFactor) {
std::feclearexcept(FE_ALL_EXCEPT);
float result = value * pointScaleFactor;
if (std::fetestexcept(FE_OVERFLOW) != 0) {
LOG(ERROR) << "Binding::scale - FE_OVERFLOW - value: " << value
<< " pointScaleFactor: " << pointScaleFactor
<< " result: " << result;
}
if (std::fetestexcept(FE_UNDERFLOW) != 0) {
LOG(ERROR) << "Binding::scale - FE_UNDERFLOW - value: " << value
// Test the product rather than the floating-point status flags, which take a
// library call and a status register access each
if (std::isinf(result) && !std::isinf(value)) {
LOG(ERROR) << "Binding::scale - overflow - value: " << value
<< " pointScaleFactor: " << pointScaleFactor
<< " result: " << result;
}
Expand Down
Loading