changeset 32297:0e033c4385a5 stable

delaunayn: Also warn for negative integers with large magnitude (bug #64658). * scripts/geometry/delaunay.m: Also warn for negative integers with large magnitude.
author Markus Mützel <markus.muetzel@gmx.de>
date Wed, 13 Sep 2023 16:29:20 +0200
parents eccbf170743f
children 82d5feec546f 0d98002c141d
files scripts/geometry/delaunayn.m
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/geometry/delaunayn.m	Tue Sep 12 22:21:20 2023 -0400
+++ b/scripts/geometry/delaunayn.m	Wed Sep 13 16:29:20 2023 +0200
@@ -88,13 +88,13 @@
     T = __delaunayn__ (pts, varargin{:});
   endif
 
-  ## Avoid erroneous calculations due to int truncation.  See bug #64658.
-  ## TODO: Large integer values in excess of flintmax can lose precision
-  ##       when converting from (u)int64 to double.  Consider modifying
-  ##       simplex checking to account for large integer math to avoid this
-  ##       problem.
+  ## Avoid erroneous calculations due to integer truncation.  See bug #64658.
+  ## FIXME: Large integer values in excess of flintmax can lose precision
+  ##        when converting from (u)int64 to double.  Consider modifying
+  ##        simplex checking to account for large integer math to avoid this
+  ##        problem.
   if (isinteger (pts))
-    if (any (pts(:) > flintmax ('double')))
+    if (any (abs (pts(:)) > flintmax ('double')))
       warning (["delaunayn: conversion of large integer values to ", ...
                 "double, potential loss of precision may result in " ...
                 "erroneous triangulations."]);