Home >Backend Development >C#.Net Tutorial >How to get the extreme value of a numerical value in C++
This article mainly introduces how to obtain numerical extreme values in C++. The editor thinks it is quite good. Now I will share it with you and give it as a reference. Let’s follow the editor and take a look
include <iostream> #include <limits> using namespace std; #define L_VALUE(a) (cout<<(#a)<<" is "<<(a)<<endl) #define L_ADDR(a) printf("%p\n", a) int main() { L_VALUE(numeric_limits<short>::max()); L_VALUE(numeric_limits<int>::max()); L_VALUE(numeric_limits<long>::max()); L_VALUE(numeric_limits<float>::max()); L_VALUE(numeric_limits<double>::max()); getchar(); getchar(); return 0; }
Related recommendations:
Numerical analysis: data interpolation method
The above is the detailed content of How to get the extreme value of a numerical value in C++. For more information, please follow other related articles on the PHP Chinese website!