generic functions for arrays to int and float