Numeric leak

From: bv (bvoh_at_Xsdynamix.com)
Date: 08/26/04


Date: Thu, 26 Aug 2004 20:47:14 GMT

I was chasing down dangling digits while using "foreign" code. When all
else failed to explain the phenomenon I took a wild guess and extracted,
what turned to be, the offending culprit - so, *check* your compiler!

      program leak
      real*8 t,dt,h
      data h/.05d0/, ns/50/

      dt = h/ns
      t = 0
      do i=1,ns
        t = t + dt
      enddo
      print*,t
      print*,sngl(t),dt
      end

compiler: xyz - yours?
  5.000000000000004E-002
  5.0000001E-02 1.000000000000000E-003

compiler: wcm
  0.050000000000000
  0.0500000 0.001000000000000

btw, the real beaut is the *sngl* deus ex machina - a true olympic feat!



Relevant Pages

  • Re: UFFI does massive consing?
    ... For efficient access to foreign variables, SBCL's compiler and foreign ... compiler notes from SBCL telling you where it has failed to optimize ... sure that all alien types are completely identified will probably ...
    (comp.lang.lisp)
  • Re: OpenSSH 3.8p1 Privilege Separation and "connection closed" error at KEXINIT
    ... > The debug doesn't shed much light. ... A wild guess is zlib: ... Which compiler are you using? ...
    (comp.security.ssh)
  • Re: Llandudno Radio Rally
    ... when I program PIC chips I prefer either assembler or a BASIC ... compiler to any of the c options. ... It was certainly foreign when you were used to BASIC. ...
    (uk.radio.amateur)
  • Re: NullPointerException with FileInputStream
    ... Wild guess: ... the declaration of HITS_FILENAME was changed to ... Since a Java compiler grabs the value ... Try recompiling ...
    (comp.lang.java.programmer)
  • -B ?
    ... gnatmake: no Ada mains; use -B to build foreign main ... Clearly "-B" has been give yet the compiler does not compile anything. ...
    (comp.lang.ada)