Make default CostEvaluator work with arbitrary numeric types
Merge pull request #3522 from jexp/2.1-maint

Make default CostEvaluator work with arbitrary numeric types
Merge '2.1' into '2.2'

Makes the default CostEvaluator work with arbitrary numeric types.