[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #62947] nextpow2 gives incorrect result for 0.
From: |
Marco Caliari |
Subject: |
[Octave-bug-tracker] [bug #62947] nextpow2 gives incorrect result for 0.5 <= x < 1 |
Date: |
Wed, 24 Aug 2022 03:46:47 -0400 (EDT) |
URL:
<https://savannah.gnu.org/bugs/?62947>
Summary: nextpow2 gives incorrect result for 0.5 <= x < 1
Project: GNU Octave
Submitter: caliari
Submitted: Wed 24 Aug 2022 07:46:46 AM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: dev
Discussion Lock: Any
Operating System: Any
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Wed 24 Aug 2022 07:46:46 AM UTC By: Marco Caliari <caliari>
The following
nextpow2(0.5)
gives -0.5, while it should be -1. And
nextpow2(0.6)
gives 0.6 itself, while it should be 0 (and the same for any other value x,
0.5 < x < 1). What about something like
n = zeros (size (x));
idx = (x != 0);
n(idx) = ceil (log2 (abs (x(idx))));
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62947>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #62947] nextpow2 gives incorrect result for 0.5 <= x < 1,
Marco Caliari <=
- [Octave-bug-tracker] [bug #62947] nextpow2 gives incorrect result for 0.5 <= x < 1, Markus Mützel, 2022/08/24
- [Octave-bug-tracker] [bug #62947] nextpow2 gives incorrect result for 0.5 <= x < 1, Markus Mützel, 2022/08/24
- [Octave-bug-tracker] [bug #62947] nextpow2 gives incorrect result for 0.5 <= x < 1, Rik, 2022/08/24
- [Octave-bug-tracker] [bug #62947] nextpow2 gives incorrect result for 0.5 <= x < 1, Markus Mützel, 2022/08/24
- [Octave-bug-tracker] [bug #62947] nextpow2 gives incorrect result for 0.5 <= x < 1, Markus Mützel, 2022/08/24
- [Octave-bug-tracker] [bug #62947] nextpow2 gives incorrect result for 0.5 <= x < 1, Rik, 2022/08/24
- [Octave-bug-tracker] [bug #62947] nextpow2 gives incorrect result for 0.5 <= x < 1, John W. Eaton, 2022/08/24