range-based numeric algorithms