mirror of
https://github.com/Karaka-Management/cOMS.git
synced 2026-01-28 02:18:40 +00:00
Add abs function
This commit is contained in:
parent
4829158b78
commit
207d3ef978
|
|
@ -20,6 +20,10 @@
|
|||
__typeof__ (b) _b = (b); \
|
||||
_a < _b ? _a : _b; })
|
||||
|
||||
#define abs(a) \
|
||||
({ __typeof__ (a) _a = (a); \
|
||||
_a > 0 ? _a : -_a; })
|
||||
|
||||
#define deg2rad(angle) \
|
||||
({ __typeof__ (angle) _angle = (angle); \
|
||||
(_angle) * M_PI / 180.0; })
|
||||
|
|
@ -28,4 +32,4 @@
|
|||
({ __typeof__ (angle) _angle = (angle); \
|
||||
(_angle) * 180.0 / M_PI; })
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user