浮点常量
类似于整数常数,使用浮点数常数亦可增加程式码的可读性,在编译程式时,编译器会自动将浮点数常数转换成可用于运算的数值。
范例:
n = .005;
浮点数常数可以被表示为科学记号 E 或者 e,即指数表示法。
浮点数常数 | 等于 | 又等于 |
10.0 | 10 | |
2.34E5 | 2.34 * 10^5 | 234000 |
67e-12 | 67.0 * 10^-12 | .000000000067 |
本页由热血青年 LBU 译自英文版。
The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.