13
13
#include < string>
14
14
#endif
15
15
#include < cmath>
16
+ #if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99_MATH_TR1)
17
+ using std::roundf;
18
+ #else
19
+ using ::roundf;
20
+ #endif
16
21
#include " IRsend.h"
17
22
#include " IRremoteESP8266.h"
18
23
#include " IRtext.h"
@@ -489,9 +494,9 @@ void IRac::argo(IRArgoAC *ac,
489
494
ac->begin ();
490
495
ac->setPower (on);
491
496
ac->setMode (ac->convertMode (mode));
492
- ac->setTemp (static_cast <uint8_t >(std::round (degrees)));
497
+ ac->setTemp (static_cast <uint8_t >(roundf (degrees)));
493
498
if (sensorTemp != kNoTempValue ) {
494
- ac->setSensorTemp (static_cast <uint8_t >(std::round (sensorTemp)));
499
+ ac->setSensorTemp (static_cast <uint8_t >(roundf (sensorTemp)));
495
500
}
496
501
ac->setiFeel (iFeel);
497
502
ac->setFan (ac->convertFan (fan));
@@ -537,7 +542,7 @@ void IRac::argoWrem3_ACCommand(IRArgoAC_WREM3 *ac, const bool on,
537
542
ac->setMode (ac->convertMode (mode));
538
543
ac->setTemp (degrees);
539
544
if (sensorTemp != kNoTempValue ) {
540
- ac->setSensorTemp (static_cast <uint8_t >(std::round (sensorTemp)));
545
+ ac->setSensorTemp (static_cast <uint8_t >(roundf (sensorTemp)));
541
546
}
542
547
ac->setiFeel (iFeel);
543
548
ac->setFan (ac->convertFan (fan));
@@ -563,7 +568,7 @@ void IRac::argoWrem3_ACCommand(IRArgoAC_WREM3 *ac, const bool on,
563
568
void IRac::argoWrem3_iFeelReport (IRArgoAC_WREM3 *ac, const float sensorTemp) {
564
569
ac->begin ();
565
570
ac->setMessageType (argoIrMessageType_t::IFEEL_TEMP_REPORT);
566
- ac->setSensorTemp (static_cast <uint8_t >(std::round (sensorTemp)));
571
+ ac->setSensorTemp (static_cast <uint8_t >(roundf (sensorTemp)));
567
572
ac->send ();
568
573
}
569
574
@@ -738,7 +743,7 @@ void IRac::coolix(IRCoolixAC *ac,
738
743
// No Econo setting available.
739
744
// No Quiet setting available.
740
745
if (sensorTemp != kNoTempValue ) {
741
- ac->setSensorTemp (static_cast <uint8_t >(std::round (sensorTemp)));
746
+ ac->setSensorTemp (static_cast <uint8_t >(roundf (sensorTemp)));
742
747
} else {
743
748
ac->clearSensorTemp ();
744
749
}
@@ -1128,7 +1133,7 @@ void IRac::ecoclim(IREcoclimAc *ac,
1128
1133
ac->setTemp (degrees);
1129
1134
ac->setFan (ac->convertFan (fan));
1130
1135
if (sensorTemp != kNoTempValue ) {
1131
- ac->setSensorTemp (static_cast <uint8_t >(std::round (sensorTemp)));
1136
+ ac->setSensorTemp (static_cast <uint8_t >(roundf (sensorTemp)));
1132
1137
} else {
1133
1138
ac->setSensorTemp (degrees); // < Set to the desired temp
1134
1139
// until we can disable.
@@ -1174,7 +1179,7 @@ void IRac::electra(IRElectraAc *ac,
1174
1179
ac->setMode (ac->convertMode (mode));
1175
1180
ac->setTemp (degrees);
1176
1181
if (sensorTemp != kNoTempValue ) {
1177
- ac->setSensorTemp (static_cast <uint8_t >(std::round (sensorTemp)));
1182
+ ac->setSensorTemp (static_cast <uint8_t >(roundf (sensorTemp)));
1178
1183
}
1179
1184
ac->setFan (ac->convertFan (fan));
1180
1185
ac->setSwingV (swingv != stdAc::swingv_t ::kOff );
@@ -2288,7 +2293,7 @@ void IRac::sanyo(IRSanyoAc *ac,
2288
2293
ac->setMode (ac->convertMode (mode));
2289
2294
ac->setTemp (degrees);
2290
2295
if (sensorTemp != kNoTempValue ) {
2291
- ac->setSensorTemp (static_cast <uint8_t >(std::round (sensorTemp)));
2296
+ ac->setSensorTemp (static_cast <uint8_t >(roundf (sensorTemp)));
2292
2297
} else {
2293
2298
ac->setSensorTemp (degrees); // Set the sensor temp to the desired
2294
2299
// (normal) temp.
0 commit comments