Why this is an Error ?
float (^isFloat)(float) = ^(float d)
{
return d*2.0;
};
At the sometime, the following is error free,
float (^isFloat)(float) = ^(float d)
{
return d;
};
PLease help me understand.
Because your return type on the first block is incorrect.
You defined the block to return a float
, but you multiplied a float
by a double
. If you change it to d * 2.0f
everything should work just fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With