Better way to cast the number of samples to int.