Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!uvaarpa!mcnc!rti!mozart!walker From: walker@unx.sas.com (Doug Walker) Newsgroups: comp.sys.amiga Subject: Re: Lattice atof() Bug? Message-ID: <1990Sep11.204739.2049@unx.sas.com> Date: 11 Sep 90 20:47:39 GMT References: <29545@nigel.ee.udel.edu> Organization: SAS Institute Inc. Lines: 28 In article <29545@nigel.ee.udel.edu> R_MCINTI%UNHH.BITNET@mitvma.mit.edu writes: >> regarding the atof() problem in lattice "C" > >The atof() seems to work fine; the difficulty is in the >printf() routine. I beleive with many vendors there are >two seperate printf() functions; one for interger math , and >one for double precision. It is perhaps the latter function >that is too blame - in fact it may not exist - which would explain >why when you write printf("%f",double_number) you end up with "%f" >on the screen since the first function is unaware of the %f option, therefore >treats it as though it is a string. > You're totally correct; there is a non-floating-point version of printf in lc.lib that ignores %f, %g and the like. This is in order to save space in the final executable. Make sure you're linking with a math library (lcm.lib, for example) BEFORE lc.lib and amiga.lib. If it's not listed BEFORE lc.lib, the printf in lc.lib will get picked up as your printf, and you won't see any substitution for the %f. ***** =*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 = *|. o.| || | o |// For all you do, this bug's for you! ====== usenet: ...mcnc!rti!sas!walker plink: dwalker bix: djwalker