Fix mixed type call to max
Change-Id: I12c262fbdc2b2b489c02871fb9477bf25a0cfb6b
Reviewed-on: https://swiftshader-review.googlesource.com/4050
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Greg Hartman <ghartman@google.com>
diff --git a/src/Common/Math.hpp b/src/Common/Math.hpp
index e2d7409..4d0d06b 100644
--- a/src/Common/Math.hpp
+++ b/src/Common/Math.hpp
@@ -323,7 +323,7 @@
const float blue_c = sw::max(0.0f, sw::min(MaxValue, blue));
const float max_c = sw::max(sw::max(red_c, green_c), blue_c);
- const float exp_p = sw::max(-Bias - 1.0f, floor(log(max_c))) + 1.0f + Bias;
+ const float exp_p = sw::max(-Bias - 1.0f, floorf(log(max_c))) + 1.0f + Bias;
const int max_s = static_cast<int>(floor((max_c / (pow(2.0f, exp_p - Bias - MantissaBits))) + 0.5f));
const int exp_s = static_cast<int>((max_s < pow(2.0f, MantissaBits)) ? exp_p : exp_p + 1);