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

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.

主站蜘蛛池模板: 松阳县| 永川市| 广德县| 湟源县| 东光县| 昌平区| 隆德县| 宜兰县| 丁青县| 桂阳县| 玉山县| 永康市| 永清县| 温泉县| 水城县| 凉山| 玉溪市| 绥滨县| 弥渡县| 长泰县| 宁晋县| 潞西市| 澎湖县| 隆回县| 神池县| 揭西县| 宁安市| 神农架林区| 高阳县| 双鸭山市| 石柱| 同江市| 南康市| 宝兴县| 大荔县| 冀州市| 云和县| 星子县| 白河县| 山东| 漠河县|