Should I write CGFloat values with postfix for not?
f
CGFloat fValue = 1.2;
against.
CGFloat fValue = 1.2f;
I know this postfix defines a float value. But is it necessary, does it make sense, are there differences in performance between the two, or is it just a visual representation so that you can quickly determine the type of value (for example, float in this case)?
1.2 is double; i.e. a 64-bit double-precision floating-point number.
double
1.2f is a float; i.e. a 32-bit single-precision floating-point number.
float
, float double double float . , , , .
:
1,0 1.
1.0f -
(123.0) .
, () . f , , .