Floating Point Numbers in C
A real or floating-point number has an integral part and a fractional part which are separated by a decimal point.
e.g. 0.01 70.456 3e+5 .5067e-16 3.14159
Floating-point numbers can be either positive or negative and are always signed numbers. Floating point numbers can be positive or negative. There are three floating types
- long double.
Exponential (scientific) notation can be used to represent real numbers such as 123000.0 = 1.23×105 = 1.23e5 = 1.23E5.
e or E is read as “times 10 to the power” e.g. 0.34e-4 = 0.000034 2500 = 25e2
|Number||Scientific Notation||Exponential Notation|
A note on floats
A suffix can be appended to a floating constant to specify its type
|F f or F||float||3.7|
|l or L||long double||3.7L|
Support us by sharing this post