I am writing a fortran code, which works with high precision. Here I am trying to use ISO_FORTRAN_ENV to achieve that. I find out that if I subtract two small number, the answer I get will be zero. But if I add them it would be fine.
Here is my program:
program test
USE ISO_FORTRAN_ENV, ONLY : REAL32
IMPLICIT NONE
REAL(REAL32), PARAMETER :: RE_L=-1.7499576837060936950743114606, &
RE_R=-1.7499576837060933110499019727
REAL(REAL32) :: A
A=(RE_R)-(RE_L)
PRINT 20, A
20 FORMAT(f50.40)
end program test
The result I got is 0.00000000000000000000000000000. And I do not know why.