Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!uxc!uxc.cso.uiuc.edu!m.cs.uiuc.edu!s.cs.uiuc.edu!haskins From: haskins@s.cs.uiuc.edu Newsgroups: comp.lang.c Subject: TurboC v2.0 format problem Message-ID: <207600024@s.cs.uiuc.edu> Date: 14 Jun 89 17:24:00 GMT Lines: 39 Nf-ID: #N:s.cs.uiuc.edu:207600024:000:946 Nf-From: s.cs.uiuc.edu!haskins Jun 14 12:24:00 1989 I have a printf formatting problem with TurboC v2.0: when I do this with the Huge model and the Tiny model, I get the results shown, w/ and w/o debugging info. I tried it with UNIX cc to make sure it wasn't me, and it comes out right. Results of printf with format %7.3f: a = 0.01 ^^^^^ won't give me another trailing 0 b = 0.011 c = 0.100 /* the program testing the printf function */ #include main() { float a,b,c; a = 0.01; b = 0.011; c = 0.1; printf("a =%7.3f\n",a); printf("b =%7.3f\n",b); printf("c =%7.3f\n",c); } With various combinations of code, the problem appears and disappears. Ordinarily this wouldn't be so horrible, but I'm working on a program that puts values in a table and this doesn't look so hot. And no, I don't have Compu$erve access if it's been mentioned there. Thanks in advance. ---------------------------------------------------------- Lloyd Haskins -- haskins@s.cs.uiuc.edu