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: Thu, 29 Jun 2023 13:13:40 -0400 (EDT)

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

Okay, with the specified compilation flags I can reproduce this behavior.

Minimal example is now


format longe
x = (-1:0.2:0.8)
x - 0


There is definitely a difference between the code that uses indexing (no for
loop) and the code that uses looping (array_value).  Simplest way to see that
is


x(6) == 0
ans = 1
[x](6) == 0
ans = 0


Besides elem() and array_value(), there is another function signature that
accepts an index vector.


Array<T> index (const idx_vector& idx)


It has similar code to elem() and also behaves similarly as shown below.


x([5 6 7]) == 0
ans =

  0  1  0





    _______________________________________________________

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]