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: Rik
Subject: [Octave-bug-tracker] [bug #64361] sinc() return NaN on sinc(-1:0.20:1-0.20) expression
Date: Wed, 28 Jun 2023 15:27:27 -0400 (EDT)

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

Could the original reporter try this code and paste the results back to this
bug report?


format long
x = -1:0.20:1-0.20;
x(6)
xpi = pi * x(6)
xs = sin (xpi)
y = xs / xpi


There may be a subtle issue with sinc.m, but there also seems to be some
problem with the reporter's installation and libraries.  For small inputs,
sin(x) -> x and so the the sinc function (sin(x)/x) becomes x/x = 1.  Hence, I
don't see a need to test for "abs (x) > eps".  To see what I mean, try the
smallest number representable with doubles which is far smaller than eps.


octave:16> x = realmin
x = 2.2251e-308
octave:17> xpi = pi*x
xpi = 6.9903e-308
octave:18> sin (xpi)
ans = 6.9903e-308
octave:19> ans / xpi
ans = 1




    _______________________________________________________

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]