Git Product home page Git Product logo

Comments (5)

nayuki avatar nayuki commented on May 22, 2024

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.

nayuki avatar nayuki commented on May 22, 2024

I just want to double-check, does the new logic look correct to you now?

from nayuki-web-published-code.

Smilebags avatar Smilebags commented on May 22, 2024

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.

nayuki avatar nayuki commented on May 22, 2024

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.

Smilebags avatar Smilebags commented on May 22, 2024

Right, interesting. Anyway, I believe this issue is fixed now. Thanks :)

from nayuki-web-published-code.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.