TqAbs(constT &value)
Comparesvalue to the 0 of type T and returns the absolute value. Thus if T isdouble, thenvalue is compared to(double) 0.
Example:
int absoluteValue;
int myValue = -4;
absoluteValue = qAbs(myValue);
// absoluteValue == 4
constT &qMax(constT &value1, constT &value2)
Returns the maximum ofvalue1 andvalue2.
Example:
int myValue = 6;
int yourValue = 4;
int maxValue = qMax(myValue, yourValue);
// maxValue == myValue
const T &qMin(const T &value1, const T &value2)
Returns the minimum ofvalue1 andvalue2.
Example:
int myValue = 6;
int yourValue = 4;
int minValue = qMin(myValue, yourValue);
// minValue == yourValue
开根号Sqrt(),比如Sqrt(100) = 10。pow(2,3) = 8
1、 void Q_ASSERT ( bool test )
当test为假时打印出警告信息。
2、void Q_ASSERT_X ( bool test, const char * where, const char * what )
当test为假时打印出警告信息,警告信息中包含自定义信息。
举例说明:
int test(int a, int b)标签:const,Qt,int,ASSERT,yourValue,myValue,test,根号 From: https://blog.51cto.com/u_15854865/5811266
{
Q_ASSERT_X(b != 0, "test", "test by zero");
return a / b;
}