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

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

[Octave-bug-tracker] [bug #62947] nextpow2 gives incorrect result for 0.


From: Rik
Subject: [Octave-bug-tracker] [bug #62947] nextpow2 gives incorrect result for 0.5 <= x < 1
Date: Wed, 24 Aug 2022 10:51:18 -0400 (EDT)

Update of bug #62947 (project octave):

                  Status:               Confirmed => Patch Reviewed         
                 Release:                     dev => 7.2.0                  

    _______________________________________________________

Follow-up Comment #3:

This is rather amazing that a bug like this has been present in Octave for
years, probably decades.

I can confirm with Matlab as well that input of 0.5 should result in -1 and
input of 0.6 should result in 0.

This is a numerical error and should be fixed as soon as possible so I have
changed the Release field from "dev" to "7.2.0".

I reviewed the two implementations and I would prefer the one in comment #1. 
Because the output vector is never changed in size there is no advantage to
initializing it with "zeros (size (x))" before using it.

@Markus: Can you make a changeset from comment #1 and check it in on the
stable branch?  It should probably have BIST tests for inputs of 0.5 and 0.6.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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