Skip to content

fix: handle zero input case in FastSqrt function#6

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

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

Conversation

@willll
Copy link
Copy Markdown
Collaborator

@willll willll commented Jan 20, 2026

No description provided.

@robertoduarte
Copy link
Copy Markdown
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
Copy Markdown
Collaborator Author

willll commented Feb 2, 2026

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

@robertoduarte
Copy link
Copy Markdown
Owner

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

Yes that sounds good!

@robertoduarte robertoduarte force-pushed the main branch 4 times, most recently from a1001cf to ca2da42 Compare February 27, 2026 17:41
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