nex3/sass — Issue #296: Add min, max, and avg functions
Author: richthegeek
Created: 2012-02-29 18:28:29+00:00
State: open

I occasionally come across cases where i need to get the maximum of two variables. Whilst it can be solved by defining an in-Sass function like so:
```SASS
@function max($a, $b) {
@return if($a > $b, $a, $b);
}
```

This solution works, but it's a bit of a pain to define it when I need to use it for each project. It could be included in Compass, ofcourse, but it seems sort-of the wrong place for it.

If max is included, then it would be odd for min not to be included, and it's implementation is similarly trivial.

I can't think of a usecase for avg at the moment, however I think in the broader scope of increasing math-support for SASS it'd be an obvious inclusion.