]> git.tuebingen.mpg.de Git - paraslash.git/commit
mood.c: Avoid integer overflow.
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 15 Mar 2016 19:41:37 +0000 (20:41 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 15 Mar 2016 20:59:29 +0000 (21:59 +0100)
commit58566e1535a0c47ce59570598885ccabc75891bf
treed0b47591a0dd127a4283f8dfe198c05ed5c2158f
parent7505e8b0458eed519ee5121bf9a8007fb72eb17a
mood.c: Avoid integer overflow.

The quadratic deviation qd can be very large, causing the
multiplication n * qd to overflow. The new code avoids the
multiplication at the cost of two calls to int_sqrt() instead of one.
mood.c