Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!ut-emx!ibmchs!auschs!awdprime!adagio.austin.ibm.com!sdl From: sdl@adagio.austin.ibm.com (Stephen Linam) Newsgroups: comp.unix.aix Subject: Re: ? write and read double as text reliably Keywords: double precision, scanf, atof, printf, significant digits Message-ID: <4894@awdprime.UUCP> Date: 22 Jan 91 17:32:36 GMT References: <17815@brahms.udel.edu> Sender: news@awdprime.UUCP Reply-To: sdl@glasnost.austin.ibm.com Distribution: usa Organization: AIX Base Operating System Development Lines: 18 In article <17815@brahms.udel.edu>, apperson@brahms.udel.edu (Apperson H Johnson) writes: |> What is the best way to write double precision numbers if |> 1. they are to be read by people |> 2. they are to bre read by a C program, and MUST preserve their exact values. I don't have a general answer to your question, but I did find a bug in AIX 3.1 sprintf() which is causing the specific test case to fail -- the number emited by the sprintf should be 0.12345678901234548. I'll open a defect report to fix it in the next release. Please call in an APAR to get the fix before then. -------------------------------------------------------------------- Stephen Linam AWD Austin T/L: 793-3674 Bell-net: (512) 832-3674 IBM Internet: sdl@adagio.austin.ibm.com VNET: LINAM at AUSTIN Outside: sdl@glasnost.austin.ibm.com