Comments (5)
Wow, what was I thinking?! Thanks for pointing this out. Now I realize that I wrote &&
instead of ||
.
I still need to exclude length 0 because it's not a power of 2 and the Lee Fast DCT doesn't handle that case. As for checking n <= 0
instead of n == 0
, it's to be extra defensive in languages like C# that have signed integer types.
I made the fixes now, to all affected languages: 3bf2d8f
from nayuki-web-published-code.
I just want to double-check, does the new logic look correct to you now?
from nayuki-web-published-code.
Yes, I think the new logic looks correct. On another note, what mandates the power of 2 length? There doesn't seem to be anything in the math that needs a power of 2 length. I'm guessing it has something to do with particular cases which can be precomputed/shortcuts can be made if the length is a power of 2?
from nayuki-web-published-code.
The Lee fast DCT does some work on the input array, then divides it in half, recurses on each half, and recombines them. If the original length is a power of 2, then we can recurse all the way down to a base case of length 1, instead of some other odd length.
from nayuki-web-published-code.
Right, interesting. Anyway, I believe this issue is fixed now. Thanks :)
from nayuki-web-published-code.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nayuki-web-published-code.