4 ms·
> What is 0.5f, then? Since the article is about C preprocessor expressions and it says that in that context, there can't be any of them, I would say the answe
by pascal_cuoq 11y ago
> What is 0.5f, then?
Since the article is about C preprocessor expressions and it says that in that context, there can't be any of them, I would say the answer is: “not a C preprocessor expression”.
- TazeTSchnitzel 11y agoThe article says this: > And there can't be any casts because you can't write a type without at least one identifier. [...] And since there can't be any casts, there can't be any floating constants. It says that there can't be floating-point constants because there aren't casts. But I just demonstrated a way to make a floating-point constant without a cast: 0.5f. Thus, surely, the statement that there can't be floating-point constants is wrong, since the only objection to them presented is that you need casts to construct them? Edit: Ah, now I see the problem. > An integer constant expression shall have integer type and shall only have operands that are [...], and floating constants that are the immediate operands of casts Since you can only have a float constant that's an immediate operand of a cast, and since you can't have casts, you can't have floats. Aha :)