A
almurph
Hi,
I am new to C and have come accross the following line of code:
A = ( B ? A / B : 1E6 );
where:
"A" is defined to be of type float and is initially assigned the value
0, subject to change
"B" is defined to be of type short and is initially assigned the value
0, subject to change
does the above equate to:
if(B > 0)
{
A = A / B;
}
else
{
A = 1E6;
}
My first questions is - is this correct?
My second question is - can you do this B as type short. i though
this would have to be a boolean type? I'm confused.
Would appreciate any comments/suggestions/thoughts/code-sample that
you may want to offer.
Thanking you,
Al.
I am new to C and have come accross the following line of code:
A = ( B ? A / B : 1E6 );
where:
"A" is defined to be of type float and is initially assigned the value
0, subject to change
"B" is defined to be of type short and is initially assigned the value
0, subject to change
does the above equate to:
if(B > 0)
{
A = A / B;
}
else
{
A = 1E6;
}
My first questions is - is this correct?
My second question is - can you do this B as type short. i though
this would have to be a boolean type? I'm confused.
Would appreciate any comments/suggestions/thoughts/code-sample that
you may want to offer.
Thanking you,
Al.