Skip to content

Commit 172d7e3

Browse files
committed
Fix typo in abs() macro
1 parent a367b8b commit 172d7e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Arduino.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void yield(void);
121121
#undef abs
122122
#endif
123123

124-
#define abs(x) ({ typeof (x) _x = (x); _x > 0 ? _x : -x; })
124+
#define abs(x) ({ typeof (x) _x = (x); _x > 0 ? _x : -_x; })
125125
#define sq(x) ({ typeof (x) _x = (x); _x * _x; })
126126
#define min(a,b) ({ typeof (a) _a = (a); typeof (b) _b = (b); _a < _b ? _a : _b; })
127127
#define max(a,b) ({ typeof (a) _a = (a); typeof (b) _b = (b); _a > _b ? _a : _b; })

0 commit comments

Comments
 (0)