Re: unloading smallfloat-data
Posted in 1991
Path: emory!europa.asd.contel.com!darwin.sura.net!wupost!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!pitt!darth!investor.pgh.pa.us!rbp From: rbp@investor.pgh.pa.us (Bob Peirce #305) Newsgroups: comp.databases.informix Message-ID: <1991Dec13.134143.5189@investor.pgh.pa.us> Date: 13 Dec 91 13:41:43 GMT References: <14911@sbsvax.cs.uni-sb.de> Reply-To: rbp@investor.pgh.pa.us (Bob Peirce #305) Organization: Cookson, Peirce & Co., Pittsburgh, PA In article <14911@sbsvax.cs.uni-sb.de> becker@ukh840.med-in.uni-sb.de writes: >Problems unloading smallfloat - numbers > >I am storing some laboratory-results as smallfloat-numbers. Now it is >necessary to unload data for statistical analyses with SPSS. >Data which have been entered into INFORMIX as round numbers >lead to unloaded data with many positions after the decimal point. > 1.31 ---> 1.3099999 >This problem, which is well known in programming environnement, induces >a growing of the unload - file and to unwanted output of the statistics. >Naturally, there is a way to avoid this: use of filters like awk,... >but I think this is a wrong behavior of INFORMIX. I think Informix assumes whatever the form of floating point numbers on your system. Any number that doesn't have an exact internal representation will do that. We get around it by using scaled integers. For example, if we only want two decimals we store the number * 100, with appropriate rounding. I think Informix actually does this for you on things declared as money. If all you need are two decimals you might try calling them money. -- Bob Peirce, Pittsburgh, PA rbp@investor.pgh.pa.us 412-471-5320 venetia@investor.pgh.pa.us [NeXT Mail] !uunet.uu.net!pitt!investor!rbp [UUCP]