“Min()”的版本間的差異
來自ALSROBOT WiKi
(以“<pre style="color:blue"> #define min(a, b) ((a)<(b)?(a):(b)) </pre> 最小值<br> 取兩者之間最小值. 例如:<br> <pre style="color:green"> sensVal = min(sens...”為內(nèi)容創(chuàng)建頁面) |
2014年9月12日 (五) 17:12的最后版本
#define min(a, b) ((a)<(b)?(a):(b))
最小值
取兩者之間最小值. 例如:
sensVal = min(sensVal, 100); // assigns sensVal to the smaller of sensVal or 100 // ensuring that it never gets above 100.