Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!cs.utah.edu!thomson From: thomson@cs.utah.edu (Rich Thomson) Newsgroups: comp.unix.ultrix Subject: Re: Actually it's printf.. (was Re: Another C compiler bug) Keywords: binary search, printf Message-ID: <1990Nov1.163635.11464@hellgate.utah.edu> Date: 1 Nov 90 23:36:35 GMT References: <11565@sybase.sybase.com> <1990Nov1.153433.4006@cimage.com> <5017@amara.UUCP> Organization: Computer Science Department, University of Utah, SLC, UT Lines: 22 In article <5017@amara.UUCP> jcm@squid.UUCP (John Martin) writes: |No, actually I suspect that the real culprit is "printf" not rounding |properly [...] To test my hypothesis, here's a program that determines |the value below which all floating-point values will be printf'ed as |"0.000000": [program deleted] |On my DECstation 3100 running Ultrix 4.0, this produces the output: |I also tried it on different, admittedly non-mips, systems: |DECstation 3100 68k sun sparc vax/vms |(Ultrix 4.0) |hi = 9.500000e-07 hi = 5.000001e-07 hi = 5.000001e-07 hi = 5.000001e-07 |lo = 9.500000e-07 lo = 5.000000e-07 lo = 5.000000e-07 lo = 5.000000e-07 On an ESV (MIPS R3000, ES/os 1.3, MIPS cc 2.1) I obtained the same numbers as the 68k, sparc and vax/vms. I suspect it is the libraries in Ultrix as well. -- Rich Rich Thomson thomson@cs.utah.edu {bellcore,hplabs,uunet}!utah-cs!thomson ``If everybody is thinking the same thing, is anybody thinking?'' --Bob Johnson