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

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.

主站蜘蛛池模板: 鄯善县| 扶余县| 含山县| 鹤山市| 翼城县| 定边县| 安远县| 游戏| 卢氏县| 河曲县| 姜堰市| 房产| 宣城市| 台安县| 城固县| 余姚市| 滦南县| 泰安市| 洮南市| 绥江县| 阜南县| 娄底市| 内丘县| 和林格尔县| 资阳市| 商都县| 辉县市| 上虞市| 海安县| 新巴尔虎右旗| 正蓝旗| 甘孜县| 老河口市| 崇信县| 平江县| 靖江市| 莎车县| 安乡县| 中阳县| 渝北区| 宁化县|