- Hands-On Object:Oriented Programming with C#
- Raihan Taher
- 99字
- 2021-07-02 12:44:34
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.
推薦閱讀
- 零基礎學Visual C++第3版
- C++面向對象程序設計(微課版)
- MATLAB圖像處理超級學習手冊
- ASP.NET Core Essentials
- 算法大爆炸:面試通關步步為營
- Java面向對象程序開發及實戰
- Practical Game Design
- 單片機應用與調試項目教程(C語言版)
- C語言課程設計
- 微信小程序開發與實戰(微課版)
- ElasticSearch Cookbook(Second Edition)
- PHP與MySQL權威指南
- Julia High Performance(Second Edition)
- Data Manipulation with R(Second Edition)
- Processing開發實戰