MATLAB: Can i use int8 and double in equation and get double as answer

data types

I use the following code snippet:
the_risk = 2*new_p_fail*(t-b1_t)/((b2_t-b1_t)*(b4_t-b4_1))
Where t is int8 and all other variables are double. I need the_risk to be double but it pops out as int8. What am I missing?

Best Answer

Cast t to double i.e.
double(t)