![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C语言基础
intoSunshine
做现在的主宰者
展开
-
bit byte char short int long float double 汉字的相互关系
本文章借鉴:博客链接1bit = 1或2 (二进制数) 1byte = 8bit 1char = 1byte = 1字节 1汉字 = 2byte = 2字节 1 short = 2byte = 2字节 1 int = 4byte = 4字节 1 long = 4byte = 4字节 1 float =4byte =4字节 1 double = 8byte = 8字节...转载 2018-04-15 12:43:28 · 545 阅读 · 0 评论 -
int型字符串互相转换,限制float,double型保留几位小数,产生随机数
1.如何将int型转换为字符长型int a = 1;String aStr = a+"";2.如何将string型转化为int型String aStr = "11";int a = Integer.parseInt(aStr);3.如何限制double型保留几位小数: double a = 4.666666666; BigDecimal...原创 2018-04-15 13:42:19 · 5992 阅读 · 0 评论