From 4ad71aef1a3a04e195b879381dafaf9d1b8f2d75 Mon Sep 17 00:00:00 2001 From: willll <464311+willll@users.noreply.github.com> Date: Mon, 19 Jan 2026 19:05:25 -0500 Subject: [PATCH] fix: handle zero input case in FastSqrt function --- impl/utils.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/impl/utils.hpp b/impl/utils.hpp index fb660e7..9b32ba7 100644 --- a/impl/utils.hpp +++ b/impl/utils.hpp @@ -107,6 +107,9 @@ namespace SaturnMath */ static constexpr uint32_t FastSqrt(uint32_t src) { + if (src == 0) + return 0; + uint32_t baseEstimation = 1; uint32_t estimation = src >> 2;