From 9bdcc93fa35c4aafbe16344e6fcaf6bfbb4f1dfd Mon Sep 17 00:00:00 2001 From: misaki <1018407731@qq.com> Date: Fri, 18 Apr 2025 09:00:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Fortran/FUNC_sign.f90 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Fortran/FUNC_sign.f90 diff --git a/Fortran/FUNC_sign.f90 b/Fortran/FUNC_sign.f90 new file mode 100644 index 0000000..c499f31 --- /dev/null +++ b/Fortran/FUNC_sign.f90 @@ -0,0 +1,19 @@ + + !·ûºÅº¯Êý + real*8 function FUNC_sign(A) + implicit none + + real*8 :: A + if(isnan(A)) then + FUNC_sign = A + elseif(A>0) then + FUNC_sign = 1.0 + elseif(A<0) then + FUNC_sign = -1.0 + elseif(A==0) then + FUNC_sign = 0.0 + end if + + end function + + \ No newline at end of file