You've defined BKDMG to be of type int
meaning that it can only hold integers. So, yes, if you assign it a real-number value it will round it down to the next integer value. Using double
or float
would probably suffice for this example.
Your conditions are also wrong:
if ( BK = 1 ) {
BKDMG = 1.6;
}
Because 'BK = 1' is an assignment, it always sets the value of BK to 1. The code snippet above should be:
if ( BK == 1 ) {
BKDMG = 1.6;
}