官术网_书友最值得收藏!

Real

Real values are sequences of digits with a positive or negative sign, like integers. This also makes it possible to specify fraction values:

float realNumber = 12.5f;
realNumber = 1.25e+1f;
double realdNumber = 12.5;

As you can see, the literal in the last line, 12.5, is double by default, hence it needed to be assigned to a double variable, while the first two lines specify the literal in float types. You can also specify d or D as a suffix to define a double, like f or F for float and m for decimal.

主站蜘蛛池模板: 咸宁市| 雅江县| 富阳市| 新蔡县| 微山县| 霸州市| 高平市| 岳池县| 开封市| 曲沃县| 河西区| 垣曲县| 龙岩市| 博野县| 泸州市| 木里| 阿尔山市| 盐城市| 夏邑县| 友谊县| 公安县| 巴楚县| 嘉禾县| 江北区| 五指山市| 连江县| 理塘县| 临江市| 武邑县| 嵊州市| 桓仁| 遂川县| 区。| 金寨县| 乌鲁木齐市| 闽侯县| 碌曲县| 古田县| 拜泉县| 虎林市| 永年县|