ruby Math array functions