change int to double in calc func