2015-07-03 Christophe Lyon <christophe.lyon@linaro.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / mod_large_1.f90
blob1047ad62e981d9eb5d5dfc37b3996fac5a033f63
1 ! { dg-do run }
2 ! PR fortran/24518
3 ! MOD/MODULO of large arguments.
4 ! The naive algorithm goes pear-shaped for large arguments, instead
5 ! use fmod.
6 ! Here we test only with constant arguments (evaluated with
7 ! mpfr_fmod), as we don't want to cause failures on targets with a
8 ! crappy libm.
9 program mod_large_1
10 implicit none
11 real :: r1
12 r1 = mod (1e22, 1.7)
13 if (abs(r1 - 0.995928764) > 1e-5) call abort
14 r1 = modulo (1e22, -1.7)
15 if (abs(r1 + 0.704071283) > 1e-5) call abort
16 end program mod_large_1