Tenderfoot Thahd who cares Posted June 28, 2005 Share Posted June 28, 2005 The expression I want to use is this : total = x + (( y * 3 ) / 10) + ( z * 6 ) - a - b; Somehow, total gets assigned 0 even when x,y,z,a and b are non zero. Are the brackets causing any error? Also are staments like m = 0.3 * t; supported. Or will the 0.3 be rounded off to 0? Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted June 28, 2005 Share Posted June 28, 2005 Non-integers get rounded down. Hard to say what the problem is with the first expression unless you give the values that you put into it. Link to comment Share on other sites More sharing options...
Magnificent Ornk Drakefyre Posted June 28, 2005 Share Posted June 28, 2005 Non-integer final products get rounded. m = .3 * t is supported, but yields an integer answer. Link to comment Share on other sites More sharing options...
Recommended Posts