add the "diff_sign" function

This commit is contained in:
tTh 2024-01-06 02:54:06 +01:00
parent 9c148c3d7e
commit 2d7739dd1d
1 changed files with 19 additions and 0 deletions

View File

@ -28,6 +28,25 @@ module mathstuff2
end subroutine
! ----------------------------------------------------------------
logical function diff_sign(a, b)
integer, intent(in) :: a, b
! write(0, *) "diff_sign", a, b
if ( (a .lt. 0) .and. (b .ge. 0) ) then
diff_sign = .TRUE.
return
endif
if ( (a .ge. 0) .and. (b .lt. 0) ) then
diff_sign = .TRUE.
return
endif
diff_sign = .FALSE.
end function
! ----------------------------------------------------------------
end module mathstuff2