We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a736a95 commit fe268e6Copy full SHA for fe268e6
cores/esp8266/Arduino.h
@@ -217,7 +217,7 @@ void optimistic_yield(uint32_t interval_us);
217
// undefine stdlib's definitions when encountered, provide abs that supports floating point for C code
218
#ifndef __cplusplus
219
#undef abs
220
-#define abs(x) ({ __typeof__(x) _x = (x); _x > 0 ? _x : -_x; })
+#define abs(x) ({ __typeof__(x) _x = (x); _x >= 0 ? _x : -_x; })
221
#undef round
222
#define round(x) ({ __typeof__(x) _x = (x); _x >= 0 ? (long)(_x + 0.5) : (long)(_x - 0.5); })
223
#endif // ifndef __cplusplus
0 commit comments