首页 > 其他分享 >[Code-Palace] 各种数据类型在当前系统的存储

[Code-Palace] 各种数据类型在当前系统的存储

时间:2023-01-18 18:34:59浏览次数:68  
标签:Code Palace MAX 数据类型 long double %. printf Biggest

#include <stdio.h>
#include <stdlib.h>
#include <float.h>
#include <limits.h>

int main() {
    printf("Smallest char: %hhd\n", CHAR_MIN);
    printf("Biggest char: %hhd\n", CHAR_MAX);
    printf("Biggest unsigned char: %hhu\n\n", UCHAR_MAX);

    printf("Smallest short: %hd\n", SHRT_MIN);
    printf("Biggest short: %hd\n", SHRT_MAX);
    printf("Biggest unsigned short: %hu\n\n", USHRT_MAX);

    printf("Smallest int: %d\n", INT_MIN);
    printf("Biggest int: %d\n", INT_MAX);
    printf("Biggest unsigned int: %u\n\n", UINT_MAX);

    printf("Smallest long: %ld\n", LONG_MIN);
    printf("Biggest long: %ld\n", LONG_MAX);
    printf("Biggest unsigned long: %lu\n\n", ULONG_MAX);

    printf("Smallest long long: %lld\n", LLONG_MIN);
    printf("Biggest long long: %lld\n", LLONG_MAX);
    printf("Biggest unsigned long long: %llu\n\n", ULLONG_MAX);

    printf("One byte = %d bits on this system.\n\n", CHAR_BIT);

    printf("float has a size of %zd bytes.\n", sizeof(float));
    printf("float precison = %d digits\n", FLT_DIG);
    printf("float epsilon = %.10E\n", FLT_EPSILON);
    printf("Smallest normal float: %.10E\n", FLT_MIN);
    printf("Largest normal float: %.10E\n\n", FLT_MAX);

    printf("double has a size of %zd bytes.\n", sizeof(double));
    printf("double precison = %d digits\n", DBL_DIG);
    printf("float epsilon = %.10lE\n", DBL_EPSILON);
    printf("Smallest double: %.10lE\n", DBL_MIN);
    printf("Largest double: %.10lE\n\n", DBL_MAX);

    printf("long double has a size of %zd bytes.\n", sizeof(long double));
    printf("long double precison = %d digits\n", LDBL_DIG);
    printf("float epsilon = %.10LE\n", LDBL_EPSILON);
    printf("Smallest long double: %.10LE\n", LDBL_MIN);
    printf("Largest long double: %.10LE\n\n", LDBL_MAX);

    system("pause");
    return 0;
}

标签:Code,Palace,MAX,数据类型,long,double,%.,printf,Biggest
From: https://www.cnblogs.com/fjnhyzCYL/p/17060374.html

相关文章

  • AtCoder Beginner Contest 047
    A-FightingoverCandies签到#include<bits/stdc++.h>usingnamespacestd;intread(){...}constintN=1e6+5;intmain(){inta=read(),b=read(......
  • [Code-Palace] 各种数据类型的二进制表示
    生成的二进制码被保存在"data.exe"文件请用VSCode中的HexEditor或其他二进制编辑器查看#include<stdio.h>#include<stdlib.h>voidchar_out();voidunsigned_c......
  • Codeforces Round #834 (Div. 3) A~E泛做
    A.Yes-Yes?构造一个\(N=50\)的字符串,判断是不是子串即可。#include<bits/stdc++.h>usingnamespacestd;#defineendl'\n'#definecerr(x)std::cerr<<(#x)<<......
  • VSCode debug gradle multiple-project 项目
    项目分层(阿里巴巴Java开发手册推荐)Gradle项目在APPproject的build.gradle中配置依赖其他project,执行task会输出到build文件夹默认debug的时候会创建launch.json{......
  • Codeforces Round #740 C
    C.Bottom-TierReversals题链这种翻转方式显然我们是要从后往前固定元素我们先来判断无解情况因为他只允许在奇数位置rev那么我们可以发现每个位置的奇偶性都不会改......
  • C#调用CODESOFT标签打印
    1、创建标签模板2、在C#项目中引用CODESOFT插件在项目中引用软件对应插件,路径见下图"Lppx2.tlb"  添加成功后,在引用中会出现: ......
  • 数据类型的转换
    #数据类型转换#万物皆可转字符串,字符串要想转成数字必须确保字符串里面的内容均是数字才行x=6int(x)#将数字类型转换成字符串num_str=str(11)print(type(num......
  • 数据类型python
    type()语句的用法运行结果......
  • ClickHouse常见数据类型以及常用SQL语法
    文章目录1.数值类型(整形,浮点数,定点数)2.字符串类型3.时间类型4.枚举类型5.布尔值6.其他数据类型7.ClickHouse与Mysql数据类型对比8.常见SQL语法和注意事项1.......
  • Codeforces Global Round 16 E
    E.BudsRe-hanging题链观察样例我们发现我们要尽可能的分解出来bud然后再来组合拼在一起是最优的当然我们可以从深度最深的开始判断是不是bud但是我们再观察发现只......