Re: Informix can't handle arithmetic expressions ?
Posted in 1995
Topics: General Discussion
In article <3uo90p$18q@brachio.zrz.tu-berlin.de>, Klaus Dobrindt <dobrahs1@mailszrz.zrz.TU-Berlin.DE> wrote: > >I was was really surprised, when I noticed that Informix >didn't evaluate arithmetic expressions right, 1 / 2 will be 0 , if stored in >a variable, 1 / 2 will be 1 in an arithmetic expression. > >Is this a known bug (or feature) ? > >A small piece of code follows to demonstate the effect. > > >Ciao Klaus > >################################################################## >GLOBALS >DEFINE > p_wiederimma CHAR(3), > semi integer, > diffdata integer, > diffdata1 integer, > anz_hs integer, > p_hs_sem_ges CHAR(2), > JJi integer >END GLOBALS > This is not wierd behaviour at all - what is the definition of an INTEGER ? If you want to calculate 1 / 2 and get the answer 0.5 then this cannot be stored in an integer. Ian Bucklar ========================================================================= || C R Y S T A L C L E A R C O M P U T E R S E R V I C E S L T D || || +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ || || Ian Bucklar + Managing Director || || || || Premier House + Email: irb@crystal.co.uk || || Forest Court + || || Oaklands Park, Wokingham + Phone: +44 (1734) 776144 || || Berkshire RG11 2FD (UK) + Fax: +44 (1734) 776055 || =========================================================================