software-mansion / software-mansion/TypeGPU
fix: Expand the signature of `std.sign` and `std.floor` to accept the union `number | d.v2f | d.v3f | d.v4f`
Open
Beginner friendly
Nobody has claimed this yet.
bug
- Dominant language
- TypeScript
- Stars
- 3.2k
- Forks
- 122
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 34
Description
const remainder = (x: number | d.v2f, y: number | d.v2f) => {
'use gpu';
const truncDiv = std.sign(x / y) * std.floor(std.abs(x / y));
// ^^^^^ ^^^^^^^^^^^^^^
return x - y * truncDiv;
};
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the std.sign and std.floor entry points and their current type signatures. Check the remainder example with number | d.v2f, then verify that both functions accept number | d.v2f | d.v3f | d.v4f and that the relevant type checks pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, computer-graphics
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 67/100