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: Markus Mützel
Subject: [Octave-bug-tracker] [bug #62947] nextpow2 gives incorrect result for 0.5 <= x < 1
Date: Wed, 24 Aug 2022 04:07:42 -0400 (EDT)

Update of bug #62947 (project octave):

                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up Comment #1:

I can confirm this issue.

The "dump" approach would be to implement this function as the following:

function n = nextpow2 (x)

  n = ceil (log2 (abs (x)));
  n(x==0) = 0;

endfunction


Is there a reason why it is implemented differently at the moment?


    _______________________________________________________

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]