Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!wuarchive!waikato.ac.nz!johnc From: johnc@waikato.ac.nz Newsgroups: comp.sys.mac.programmer Subject: Re: Bug with THINK C 4.0 scanf()? Message-ID: <1991May1.123600.3571@waikato.ac.nz> Date: 1 May 91 00:36:00 GMT References: <1991Apr30.081412.8116@beaver.cs.washington.edu> Distribution: na Organization: University of Waikato, Hamilton, New Zealand Lines: 28 In article <1991Apr30.081412.8116@beaver.cs.washington.edu>, chou@cs.washington.edu (Pai Chou) writes: > I am having a problem with THINK C's scanf for doubles. > For example, if I scan in a double like 0.0258, I get back 0.258 > -- it seems that the leading zeros are ignored. > > Is anybody else having the same problem? Does anyone > know a fix? I am using version 4.0. Is it fixed in > the upgrade? Thanks > > Pai Chou > chou@june.cs.washington.edu I'm having exactly the same problem and was searching this newsgroup for the answer! The only way I can get sensible numbers is to put them into sci form e.g. 0.001 gets read as 0.1 unless you make it 1E-3 which I don't want to have to do. Altering the field specifier in the format string doesn't help at all e.g. "%8lf" for reading a double in a field of 8 (I'm using THINK C v4.0 too) Somebody must know! John Curtis johnc@waikato.ac.nz