Travis Cross 65e678ba1d Fix mod_expr clamp function
The clamp(v,a,b) function wraps v around the interval [a,b).

However prior to this commit, `clamp` was ignoring the third argument
and using the second argument again in its place.  This resulted in a
division by zero.  Hence `clamp` didn't work at all.

Even if the arguments were treated correctly, `clamp` incorrectly
multiplied rather than added whenever v < a.  This would have produced
bogus results.  (Thanks to Shona McNeill for pointing this out.)

Note that as implemented, `clamp` is undefined for b >= a.

These errors are present in the last upstream C version, v2.7.
They've been corrected in the C++ version that upstream now maintains
instead.

Thanks-to: Shona McNeill <prufrax@googlemail.com>

FS-7070 #resolve
2014-12-25 10:18:31 +00:00
..
2014-07-09 08:25:54 -05:00
2014-03-07 18:36:12 -05:00
2014-03-18 14:07:38 -04:00
2014-12-25 10:18:31 +00:00
2014-03-07 18:36:12 -05:00
2014-05-01 16:36:58 -04:00
2014-03-07 18:36:12 -05:00
2014-05-01 17:34:54 -04:00
2014-02-12 12:08:56 -06:00
2014-07-22 15:28:31 +00:00
2014-07-22 15:04:28 -04:00
2014-03-07 18:36:12 -05:00
2014-03-07 18:36:12 -05:00