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.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
67/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript

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.

Description

bug
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;
};
Dominant language
TypeScript
Stars
3.2k
Forks
123
Avg merge
3d 5h
Merged PRs (30d)
34

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.

More from software-mansion/TypeGPU

All issues in software-mansion/TypeGPU

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.