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

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.

主站蜘蛛池模板: 台中市| 三穗县| 宁明县| 新田县| 白城市| 永城市| 乌恰县| 辽阳市| 宁安市| 灌云县| 华容县| 长沙县| 高密市| 万源市| 璧山县| 湄潭县| 镇沅| 大兴区| 桂东县| 新蔡县| 鲁山县| 商河县| 二连浩特市| 交口县| 吴堡县| 娱乐| 瑞丽市| 正阳县| 阿克陶县| 林芝县| 肇庆市| 和顺县| 鲁甸县| 札达县| 阳谷县| 新晃| 会昌县| 宕昌县| 定陶县| 沐川县| 乌兰县|