]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authornicolas <nicolas@git.imagemagick.org>
Tue, 11 Dec 2012 15:27:48 +0000 (15:27 +0000)
committernicolas <nicolas@git.imagemagick.org>
Tue, 11 Dec 2012 15:27:48 +0000 (15:27 +0000)
MagickCore/resample.c

index e3477ddc3a834f789ae7bd495ed4b2b865cc5614..a72b58bd4f54f3bff1623b39db395393c7d02e57 100644 (file)
@@ -894,6 +894,11 @@ static inline void ClampUpAxes(const double dux,const double dvx,
   const double frobenius_squared = n11+n22;
   const double discriminant =
     (frobenius_squared+twice_det)*(frobenius_squared-twice_det);
+  /*
+   * In exact arithmetic, discriminant can't be negative. In floating
+   * point, it can, because of the bad conditioning of SVD
+   * decompositions done through the associated normal matrix.
+   */
   const double sqrt_discriminant =
     sqrt(discriminant > 0.0 ? discriminant : 0.0);
   /*