octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #64361] sinc() return NaN on sinc(-1:0.20:1-0.


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #64361] sinc() return NaN on sinc(-1:0.20:1-0.20) expression
Date: Wed, 28 Jun 2023 04:46:29 -0400 (EDT)

Follow-up Comment #2, bug #64361 (project octave):

Anyway, it might be a good idea to not compare floating point values exactly
here:
https://hg.savannah.gnu.org/hgweb/octave/file/4555f9918009/scripts/signal/sinc.m#l47
Maybe, something like this would be better?

 
   y = ones (size (x));
 
-  i = (x != 0);
+  i = (abs (x) > eps);
 
   if (any (i(:)))
     t = pi * x(i);




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64361>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]