Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Why does `math.sign` return the input type?

Open
#208 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp

Research direction

Start with the math.sign API and compare its return-type behavior with the System.Math and HLSL definitions mentioned in the issue. Determine whether returning the input type is intentional; done requires a maintainer decision about the API behavior and any corresponding project changes.

Written by the indexing model from the issue text.

Description

I noticed this difference when working on my own (mostly) compatible library.
This is different than the System.Math and hlsl definition where they always return an integer type.

Any particular reason why this change is done?

Dominant language
C#
Stars
1.4k
Forks
159
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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 Unity-Technologies/Unity.Mathematics

All issues in Unity-Technologies/Unity.Mathematics

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.