aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/mod_large_1.f90
blob: 1047ad62e981d9eb5d5dfc37b3996fac5a033f63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
! { dg-do run }
! PR fortran/24518 
! MOD/MODULO of large arguments.
! The naive algorithm goes pear-shaped for large arguments, instead
! use fmod.
! Here we test only with constant arguments (evaluated with
! mpfr_fmod), as we don't want to cause failures on targets with a
! crappy libm.
program mod_large_1
  implicit none
  real :: r1
  r1 = mod (1e22, 1.7)
  if (abs(r1 - 0.995928764) > 1e-5) call abort
  r1 = modulo (1e22, -1.7)
  if (abs(r1 + 0.704071283) > 1e-5) call abort
end program mod_large_1