Skip to content

Comments

fix: handle zero input case in FastSqrt function#6

Open
willll wants to merge 1 commit intorobertoduarte:mainfrom
willll:fix/FastSqrt_zero
Open

fix: handle zero input case in FastSqrt function#6
willll wants to merge 1 commit intorobertoduarte:mainfrom
willll:fix/FastSqrt_zero

Conversation

@willll
Copy link
Contributor

@willll willll commented Jan 20, 2026

No description provided.

@robertoduarte
Copy link
Owner

I skipped the zero check on purpose to avoid the branch penalty on the SH2, which can really bite in hot paths. What do you think about making it optional via a template argument and if constexpr? That way we keep it zero-cost by default but still provide the option for whoever needs the extra safety.

@willll
Copy link
Contributor Author

willll commented Feb 2, 2026

Hi @robertoduarte, a template parameter similar to Fx::Sqrt() ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants