Skip to content

Commit 2c88d66

Browse files
committed
Use roundf() instead of just round()
1 parent 04d6dc6 commit 2c88d66

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/ir_Eurom.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#include "IRtext.h"
1616
#include "IRutils.h"
1717

18+
#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99_MATH_TR1)
19+
using std::roundf;
20+
#else
21+
using ::roundf;
22+
#endif
23+
1824
using irutils::uint8ToBcd;
1925
using irutils::bcdToUint8;
2026
using irutils::addBoolToString;
@@ -241,7 +247,7 @@ void IREuromAc::setTemp(const uint8_t degrees, const bool fahrenheit) {
241247
if (fahrenheit) {
242248
temp_f = std::max(kEuromMinTempF, degrees);
243249
temp_f = std::min(kEuromMaxTempF, temp_f);
244-
temp_c = static_cast<uint8_t>(std::round(fahrenheitToCelsius(temp_f)));
250+
temp_c = static_cast<uint8_t>(roundf(fahrenheitToCelsius(temp_f)));
245251
_.Fahrenheit = kEuromFahrenheitEnabled + temp_f;
246252
} else {
247253
temp_c = degrees;

0 commit comments

Comments
 (0)