From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,57ce877817441ebc X-Google-Attributes: gid109fba,public X-Google-Thread: fee84,57ce877817441ebc X-Google-Attributes: gidfee84,public X-Google-Thread: 1014db,57ce877817441ebc X-Google-Attributes: gid1014db,public X-Google-Thread: f678f,57ce877817441ebc X-Google-Attributes: gidf678f,public From: fred@genesis.demon.co.uk (Lawrence Kirby) Subject: Re: DU4.0 cxx|cc MINFLOAT and MINDOUBLE wrong? Date: 1997/02/11 Message-ID: <855665252snz@genesis.demon.co.uk>#1/1 X-Deja-AN: 218046806 references: <33005FC7.41C6@ife.ee.ethz.ch> x-mail2news-user: fred@genesis.demon.co.uk x-mail2news-path: genesis.demon.co.uk organization: none reply-to: fred@genesis.demon.co.uk newsgroups: comp.unix.osf.osf1,comp.unix.osf.misc,comp.lang.c++,comp.lang.c In article <33005FC7.41C6@ife.ee.ethz.ch> witt@ife.ee.ethz.ch "Armin Wittmann" writes: >Machine: DEC alpha 3000 300/300L AXP >OS: Digital Unix 4.0 > >In the headerfile /usr/include/values.h >are all the max-min-values defined! values.h is not a standard C language header. The headers that define type limits are limits.h for integral types and float.h for floating point types. >I was surprised to see that the values of > >MINFLOAT and MINDOUBLE The macros you want are called FLT_MIN and DBL_MIN in float.h. values.h is obsolete and not portable. >are defined less then the compiler can work with! >First I thought that it is a problem with the parser >but it is not. >Then I compared the cxx and cc and it is with both the same! > >float f1 = 1.4e-38; // is ok >float f2 = f1/10; // is NOT ok! >float f3 = f2*10; // is still NOT ok! > >cout and printf gave the same results for f1,f2,f3: >float f1: 1.4013e-38 >float f2: 0 >float f3: 0 > >MINFLOAT is defined as 1.40129846432481707e-45!!! >This is the real minimun with the denormalized form. Do you have the same problem with FLT_MIN and DBL_MIN? -- ----------------------------------------- Lawrence Kirby | fred@genesis.demon.co.uk Wilts, England | 70734.126@compuserve.com -----------------------------------------