News for hackers. Stuff that matters.
Re:Show HN: How to compile C/C++ for WASM, pure Clang, no li... by syrusakbary on Monday April 11, 2022 @03:03PM (#30993204)
For future readers, this is the code that is being referred:

https://github.com/ern0/howto-wasm-minimal/blob/master/inc.c...

It should be:

    uint32_t gray = 0.299 * ptr[i] + 0.587 * ptr[i+1] + 0.114 * ptr[i+2];
    ptr[i] = gray;
    ptr[i+1] = gray;
    ptr[i+2] = gray;
Re:Show HN: How to compile C/C++ for WASM, pure Clang, no li... by ern0 on Wednesday April 13, 2022 @05:27AM (#31012660)
I know it (see: https://github.com/ern0/kolorwheel.js ), but I did not wanted use floats.