Path: utzoo!attcan!telly!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!smurf!flatlin!bagsend!pilhuhn!hwr From: hwr@pilhuhn.ka.sub.org (Heiko W.Rupp) Newsgroups: comp.sys.amiga.programmer Subject: Re: Amiga 3000, 2.0 and Lattice C Message-ID: <18a2c651.ARN12e8@pilhuhn.ka.sub.org> Date: 5 Feb 91 18:19:45 GMT References: <91031.171403FORDE@vm.poly.edu> Reply-To: hwr@pilhuhn.ka.sub.org Followup-To: comp.sys.amiga.programmer Lines: 32 Organization: Not an Organization In article <91031.171403FORDE@vm.poly.edu>, FORDE@vm.poly.edu writes: > > int var1=1; > float var2=2.3; > > printf("%d %f:n",var1,var2); > > results in: > > 1 %f > >Can anyone tell me why this is happening. I'm using Lattice C 5.10. I don't know much about SAS C (I'm using Atzec 3.6a), but you should explicitly link with the math library before standard C-library (amiga.lib). As Floating-point-code is larger than integer-code and floats are not often used, standard library-code is for integers and you have explicitly to say, that you want the float-code. -Heiko P.S.: Consult your manual about printf("%f"); -- Heiko W.Rupp, Gerwigstr.5, D-7500 Karlsruhe 1 | hwr@pilhuhn.ka.sub.org Tel: +49 7021 693642 (voice only) | uk85@dkauni2.bitnet Fresst Scheisse, Miliarden von Fliegen koennen nicht irren !