From 4ba0d23d54728510155b10e54e1539bcc90b5b74 Mon Sep 17 00:00:00 2001 From: sunwen Date: Tue, 11 Mar 2025 15:51:05 +0800 Subject: [PATCH] fix: To modify the acos function to return 0 when the result is NaN. --- src/Function1D.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Function1D.cpp b/src/Function1D.cpp index c62c573..d2df1b0 100644 --- a/src/Function1D.cpp +++ b/src/Function1D.cpp @@ -568,7 +568,9 @@ Matrix Aurora::acosd(const Matrix& aMatrix) { resultData[i] = resultData[i] * 180 / PI; } - return Matrix::New(resultData, aMatrix); + Matrix result = Matrix::New(resultData, aMatrix); + nantoval(result, 0); + return result; } Matrix Aurora::conj(const Matrix& aMatrix)