From ef75fbcbb9bb563332e661532defae531cf98c39 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Wed, 10 Jul 2024 03:51:50 +0900 Subject: [PATCH] math: ++missing exceptions --- src/common/tvgMath.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/tvgMath.cpp b/src/common/tvgMath.cpp index 578d673e..6c738e29 100644 --- a/src/common/tvgMath.cpp +++ b/src/common/tvgMath.cpp @@ -103,6 +103,7 @@ namespace tvg { //https://en.wikipedia.org/wiki/Remez_algorithm float atan2(float y, float x) { + if (y == 0.0f && x == 0.0f) return 0.0f; auto a = std::min(fabsf(x), fabsf(y)) / std::max(fabsf(x), fabsf(y)); auto s = a * a; auto r = ((-0.0464964749f * s + 0.15931422f) * s - 0.327622764f) * s * a + a;