void *memset(void *s, int c, size_t n);
相信大家对memset的形式已经很熟悉了,我只是记录一下 \(c\) 常用的取值而已...
int / long long / short
c的取值 |
int时实际取值 |
long long时实际取值 |
short时实际取值 |
备注 |
0x00 |
\(0\) |
\(0\) |
\(0\) |
|
0xff |
\(-1\) |
\(-1\) |
\(-1\) |
|
0x7f |
\(2139062143\) |
\(9187201950435737471\) |
\(32639\) |
极大值 |
0x3f |
\(1061109567\) |
\(4557430888798830399\) |
\(16191\) |
较大值 |
0xc0 |
\(-1061109568\) |
\(-4557430888798830400\) |
\(-16192\) |
较小值 |
0x80 |
\(-2139062144\) |
\(-9187201950435737472\) |
\(-32640\) |
极小值 |
float / double
c的取值 |
float时实际取值 |
double时实际取值 |
备注 |
0x00 |
\(0\) |
\(0\) |
|
0x7f |
\(3.39615\times10^{38}\) |
\(1.38242\times10^{306}\) |
极大值 |
0x6f |
\(7.41016\times10^{28}\) |
\(5.9575\times10^{228}\) |
较大值 |
0xee |
\(-3.69731\times10^{28}\) |
\(-2.28999\times10^{226}\) |
较小值 |
0xfe |
\(-1.69474\times10^{38}\) |
\(-5.31401\times10^{303}\) |
极小值 |
0x10 |
\(2.36943\times10^{-38}\) |
\(7.7486\times10^{-304}\) |
接近\(0\)的正的极小值 |
0x80 |
\(-1.1801\times10^{-38}\) |
\(-2.93745\times10^{-306}\) |
接近\(0\)的负的极大值 |
long double
c的取值 |
实际取值 |
备注 |
0x00 |
\(0\) |
|
0xdf |
\(-4.4418\times 10^{2456}\) |
较小值 |
0xfe |
\(-1.02344\times 10^{4855}\) |
极小值 |
0x80 |
\(-5.74275\times 10^{-4894}\) |
接近\(0\)的负的极大值 |