|
From: | anonymous |
Subject: | [Octave-bug-tracker] [bug #59149] [octave forge] (signal) Resampling from 22050 to 48000 Hz introduces strange and unexpected artifacts |
Date: | Thu, 24 Sep 2020 11:20:53 -0400 (EDT) |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0 |
Follow-up Comment #31, bug #59149 (project octave): It gets more insidious. The signal package uses several instances of this pattern: if (target == target) // not nan // do something else // nan // do something else Here's what happens when testing for nan with -ffast-math: $ cat test.cpp #include <iostream> int main() { double a = 0.0/0.0, b = (a + 1e-3) - 1e-3; std::cout << "a = " << a << "\nb = " << b << '\n'; if (a==b) std::cout << "Equal\n"; else std::cout << "Unequal\n"; } $ g++ test.cpp && ./a.out a = -nan b = -nan Unequal $ g++ test.cpp -ffast-math && ./a.out a = nan b = nan Equal $ clang++ test.cpp && ./a.out a = nan b = nan Unequal $ clang++ test.cpp -ffast-math && ./a.out a = nan b = nan Unequal _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?59149> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |