Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 10.3, conversion from complex types to real floating types
#1
The following code can be compiled.

Code:
float f;            // sizeof(float) = 4
double d;           // sizeof(double) = 8
float _Complex fc;  // sizeof(float _Complex) = 8

d = fc;  // violate rule 10.3 ?
fc = d;  // violate rule 10.3 ?

f = fc;  // violate rule 10.3 ?
fc = f;  // OK?

The "double type" has no imaginary parts.
So, I can say "assign to narrower essential type" ?
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)