Created
July 2, 2012 03:35
-
-
Save shouyu/3030850 to your computer and use it in GitHub Desktop.
limits check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ uname -a [/tmp] | |
Linux SVZ1311AJ 3.4.4-2-ARCH #1 SMP PREEMPT Sun Jun 24 18:59:47 CEST 2012 x86_64 GNU/Linux | |
$ ./a.out [/tmp] | |
2147483647 | |
4294967295 | |
9223372036854775807 | |
18446744073709551615 | |
9223372036854775807 | |
18446744073709551615 | |
3.40282e+38 | |
1.79769e+308 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://d.hatena.ne.jp/TOTTORIPAPER/20120107 | |
#include <iostream> | |
#include <limits.h> | |
#include <float.h> | |
int main(){ | |
std::cout << INT_MAX << std::endl;//intの最大値 | |
std::cout << UINT_MAX << std::endl;//unsigned intの最大値 | |
std::cout << LONG_MAX << std::endl;//long intの最大値 | |
std::cout << ULONG_MAX << std::endl;//unsigned long intの最大値 | |
std::cout << LLONG_MAX << std::endl;//long long intの最大値 | |
std::cout << ULLONG_MAX << std::endl;//unsigned long long intの最大値 | |
std::cout << FLT_MAX << std::endl;//floatの最大値 | |
std::cout << DBL_MAX << std::endl;//doubleの最大値 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment