Cast value to correct type before op.