Giter VIP home page Giter VIP logo

Comments (5)

curiousdannii avatar curiousdannii commented on August 18, 2024

If it's passing out of asm.js land, then it must be signed, as JS doesn't have unsigned integers. If the function is being called by another asm.js function, then my guess would be that the |0 is a nop, but I'm not certain on that.

from validator.

jlongster avatar jlongster commented on August 18, 2024

JavaScript does have unsigned integers, as forced with the >>> operator: -1 >>> 0 == 4294967295, as far as I know. But I am mostly talking about code within the asm.js land.

from validator.

kripken avatar kripken commented on August 18, 2024

For simplicity, we use signed values both when entering an asm.js function and when exiting. Standardizing on that is simpler, and matches what JS engines optimize well today anyhow (32-bit signed integers are faster than 32-bit unsigned ones, which often become doubles).

from validator.

cscott avatar cscott commented on August 18, 2024

I believe this issue can be closed.

from validator.

sunfishcode avatar sunfishcode commented on August 18, 2024

Closing; see kripken's explanation above. The functionality of unsigned return types can be achieved by casting unsigned values to signed for the return, and casting them back to unsigned on the caller side.

from validator.

Related Issues (20)

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.