public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/24518]  New: Intrinsic MOD incorrect for large arg1/arg2 and slow.
@ 2005-10-25 13:21 paul dot richard dot thomas at cea dot fr
  2005-10-25 14:37 ` [Bug fortran/24518] " pinskia at gcc dot gnu dot org
                   ` (25 more replies)
  0 siblings, 26 replies; 28+ messages in thread
From: paul dot richard dot thomas at cea dot fr @ 2005-10-25 13:21 UTC (permalink / raw)
  To: gcc-bugs

This:

  real*8 :: x = 10.0e9
  do i = 10, 22
    x = 10d0 * x
    print '(a,i2,a,g14.8)', "mod (10**",i,", 1.7_8) = ",mod (x, 1.7_8)
  end do
end

does this with cvs gfortran

mod (10**10, 1.7_8) =  1.3000026
mod (10**11, 1.7_8) =  1.1000261
mod (10**12, 1.7_8) = 0.80026150
mod (10**13, 1.7_8) =  1.2026138
mod (10**14, 1.7_8) = 0.12609863
mod (10**15, 1.7_8) =  1.2607422
mod (10**16, 1.7_8) =  5.8125000
mod (10**17, 1.7_8) = -50.687500
mod (10**18, 1.7_8) =  364.00000
mod (10**19, 1.7_8) = -.70000000E+20
mod (10**20, 1.7_8) = -.70000000E+21
mod (10**21, 1.7_8) = -.70000000E+22
mod (10**22, 1.7_8) = -.70000000E+23

and this with a leading commercial brand:

mod (10**10, 1.7_8) =  1.3000026
mod (10**11, 1.7_8) =  1.1000261
mod (10**12, 1.7_8) = 0.80026123
mod (10**13, 1.7_8) =  1.2026123
mod (10**14, 1.7_8) = 0.12612289
mod (10**15, 1.7_8) =  1.2612289
mod (10**16, 1.7_8) = 0.71228947
mod (10**17, 1.7_8) = 0.32289470
mod (10**18, 1.7_8) =  1.5289470
mod (10**19, 1.7_8) =  1.6894697
mod (10**20, 1.7_8) =  1.5946971
mod (10**21, 1.7_8) = 0.64697063
mod (10**22, 1.7_8) = 0.86970625

gfortran loses it at around 10**16 and starts producing values larger than the
second argument. Whilst, to some degree, one deserves to be hit on the nose for
trying to calculate mod for these values, a slightly less deviant behaviour
might be better.

As noted in the list http://gcc.gnu.org/ml/fortran/2005-10/msg00482.html, this
leading brand is about twice as fast in calulating mod, as gfortran, in spite
of its apparently using 64 bit arithmetic.


-- 
           Summary: Intrinsic MOD incorrect for large arg1/arg2 and slow.
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: paul dot richard dot thomas at cea dot fr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24518


^ permalink raw reply	[flat|nested] 28+ messages in thread
[parent not found: <bug-24518-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2012-05-05  8:02 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-25 13:21 [Bug fortran/24518] New: Intrinsic MOD incorrect for large arg1/arg2 and slow paul dot richard dot thomas at cea dot fr
2005-10-25 14:37 ` [Bug fortran/24518] " pinskia at gcc dot gnu dot org
2006-06-20 12:44 ` fxcoudert at gcc dot gnu dot org
2006-06-21  8:04 ` paul dot richard dot thomas at cea dot fr
2006-10-22 21:01 ` fxcoudert at gcc dot gnu dot org
2006-10-23  6:19 ` fxcoudert at gcc dot gnu dot org
2006-10-25  7:34 ` uros at kss-loka dot si
2006-10-25  8:19 ` fxcoudert at gcc dot gnu dot org
2006-10-25 11:49 ` uros at kss-loka dot si
2006-10-25 13:53 ` fxcoudert at gcc dot gnu dot org
2006-10-25 14:16 ` uros at kss-loka dot si
2006-10-26  4:04 ` sgk at troutmask dot apl dot washington dot edu
2006-10-26 20:09 ` pault at gcc dot gnu dot org
2006-10-26 22:22 ` uros at kss-loka dot si
2006-10-31 15:56 ` pault at gcc dot gnu dot org
2006-10-31 16:06 ` fxcoudert at gcc dot gnu dot org
2006-10-31 16:14 ` paul dot richard dot thomas at cea dot fr
2006-10-31 16:21 ` pault at gcc dot gnu dot org
2006-10-31 16:47 ` fxcoudert at gcc dot gnu dot org
2006-11-05  6:28 ` pault at gcc dot gnu dot org
2006-11-05  8:46 ` pault at gcc dot gnu dot org
2006-11-05 22:18 ` pault at gcc dot gnu dot org
2006-11-10 21:53 ` pault at gcc dot gnu dot org
2006-12-01  0:09 ` chaoyingfu at gcc dot gnu dot org
2006-12-02  8:12 ` ebotcazou at gcc dot gnu dot org
2006-12-02  8:23 ` burnus at gcc dot gnu dot org
2006-12-02  8:28 ` pinskia at gcc dot gnu dot org
     [not found] <bug-24518-4@http.gcc.gnu.org/bugzilla/>
2012-05-05  8:02 ` jb at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).