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
#2,821 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.