[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #51630] BIST test for log2 fails on Windows
From: |
Markus Mützel |
Subject: |
[Octave-bug-tracker] [bug #51630] BIST test for log2 fails on Windows |
Date: |
Mon, 31 Jul 2017 13:56:08 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:55.0) Gecko/20100101 Firefox/55.0 |
URL:
<http://savannah.gnu.org/bugs/?51630>
Summary: BIST test for log2 fails on Windows
Project: GNU Octave
Submitted by: mmuetzel
Submitted on: Mon 31 Jul 2017 05:56:07 PM UTC
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Regression
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: Microsoft Windows
_______________________________________________________
Details:
The BIST test for log2 is failing on Windows since a few weeks (tested with hg
id e56d84a16a2e):
>>>>> processing
D:\Repositories\Octave\test\octave-2017-07-30-17-21_gcc5\octave-2017-07-30-17-21\share\octave\4.3.0+\etc\tests\libinterp\corefcn\data.cc-tst
***** test
[f, e] = log2 ([0,-1; 2,-4; Inf,-Inf]);
assert (f, [0,-0.5; 0.5,-0.5; Inf,-Inf]);
assert (e(1:2,:), [0,1;2,3]);
!!!!! test failed
ASSERT errors for: assert (f,[0, -0.5; 0.5, -0.5; Inf, -Inf])
Location | Observed | Expected | Reason
(3,1) NaN Inf 'NaN' mismatch
(3,2) NaN -Inf 'NaN' mismatch
shared variables scalar structure containing the fields:
xs =
Compressed Column Sparse (rows = 1, cols = 4, nnz = 3 [75%])
(1, 2) -> 1
(1, 3) -> 2
(1, 4) -> 3
***** test
[f, e] = log2 (complex (zeros (3, 2), [0,-1; 2,-4; Inf,-Inf]));
assert (f, complex (zeros (3, 2), [0,-0.5; 0.5,-0.5; Inf,-Inf]));
assert (e(1:2,:), [0,1; 2,3]);
!!!!! test failed
ASSERT errors for: assert (f,complex (zeros (3, 2), [0, -0.5; 0.5, -0.5; Inf,
-Inf]))
Location | Observed | Expected | Reason
(3,1) NaN+NaNi 0+Infi 'NaN' mismatch
(3,2) NaN+NaNi 0-Infi 'NaN' mismatch
shared variables scalar structure containing the fields:
xs =
Compressed Column Sparse (rows = 1, cols = 4, nnz = 3 [75%])
(1, 2) -> 1
(1, 3) -> 2
(1, 4) -> 3
CC'ing Rik because this might be related to the recent change to use standard
library functions:
http://hg.savannah.gnu.org/hgweb/octave/rev/4c048a2792bc
Calling "log2" with one or two output argument gives these results on
Windows:
>> log2 (Inf)
ans = Inf
>> log2 (-Inf)
ans = Inf + 4.532i
>> [a,b]=log2 (Inf)
a = NaN
b = -1
>> [a,b]=log2 (-Inf)
a = NaN
b = -1
The same on Linux (correct):
>> log2 (Inf)
ans = Inf
>> log2 (-Inf)
ans = Inf + 4.532i
>> [a,b]=log2 (Inf)
a = Inf
b = 0
>> [a,b]=log2 (-Inf)
a = -Inf
b = 0
The results when calling with one output argument are correct.
The results with two output arguments (effectively calling frexp) fail on
Windows.
With 4.2.1 (and a dev build from March I found on my disk, hg id
a470f7fee1cf), the results were still correct on Windows.
Should we return to use gnulib for frexp?
According to [1], behaviour for +/-Inf is implementation specific. Is
mingw/gcc/glibc/Windows not IEC 60559 compliant?
[1] http://en.cppreference.com/w/cpp/numeric/math/frexp
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?51630>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #51630] BIST test for log2 fails on Windows,
Markus Mützel <=