Re: Informix can't handle arithmetic expressions ?
Posted in 1995
} >Have you noticed in sacego that if you multiply two smallfloats, } >you get similar results? } > } >e.g. 0.045 * 2.00 yields 0.000 } } This claim is pretty much unsubstantiated -- there is no code given, and no } detailed version information. I attach a partial refutation -- it is an } example report run on a Sun Sparc 10 running Solaris 2.4 and using OnLine } 6.00.UE1 and ISQL 6.01.UD1 and the ACE report below. The output I get is: } } f1 = 0.045, f2 = 2.000, f3 = 0.090 } 0.05 2.00 0.09 0.09 } } This looks fine to me. What's your version of the events which leads you } to assert that ACE does not know how to multiply 2 SMALLFLOAT values? } } Yours, } Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> Thanks, Jonathan. I tried your little test program - changing _ONLY_ the name of the database. The output follows the report. } } DATABASE stores END } } DEFINE } VARIABLE f1 SMALLFLOAT } VARIABLE f2 SMALLFLOAT } VARIABLE f3 SMALLFLOAT } END } } OUTPUT } TOP MARGIN 0 } BOTTOM MARGIN 0 } LEFT MARGIN 0 } PAGE LENGTH 1 } END } } SELECT * FROM Systables WHERE Tabid = 1 END } } FORMAT } } ON EVERY ROW } LET f1 = 0.045 } LET f2 = 2.00 } LET f3 = f1 * f2 } PRINT " f1 = ", f1 USING "&.&&&", } ", f2 = ", f2 USING "&.&&&", } ", f3 = ", f3 USING "&.&&&" } PRINT f1, f2, f3, f1 * f2 } } END } INFORMIX-SQL Version 4.10.UC1 Copyright (C) Informix Software, Inc., 1984-1991 Software Serial Number LEX#C170211 The reading of the database will now begin. Select statement number 1 will now be processed. The reading of the database has finished. f1 = 0.045, f2 = 2.000, f3 = 0.090 0.05 2.00 0.09 0 I'm not sure how to get the On-Line version number, but "tbstat" tells me RSAM Version 5.03.UC1 What more can I say? -- Dan Madvig e-mail: d-madvig@bethel.edu Bethel College & Seminary phone: (612) 638-6414 3900 Bethel Drive fax: (612) 638-6001 St. Paul, MN 55112 In Myrtle Beach, SC, the plethora of Calabash restaurants is as common as the dearth of Calabash restaurants is rare, and vice versa.