cast speed to int type