2011/3/7 K Shen <[email protected]>: > Hi Kai, > > --- On Mon, 7/3/11, Kai Tietz <[email protected]> wrote: > >> >> I meant y without decimal place and x without decimal >> place, which >> have for x ^ y always integer result. For x with decimal >> place and y >> without decimal place we can use here powi instead, which >> should do >> more exact rounding. >> > > By decimal place, do you mean a integer type, or do you mean an > integral value (e.g. 3.0)? In our actual code, both arguments passed > to pow() are doubles, i.e. we are effectively calling > > pow(2.0,3.0) > > You comments about using ipow() for more precision raises a question > about the precision of the general pow() for double values. The result > for the general pow(2.0, 3.0) suggest it may not achieve the precision we are > assuming. > > As I said, we have a "bounded real" type that is designed to deal with > the finite precision of any floating types. The idea is that we have upper > and lower bounds that are supposed to enclose the exact (inifinite precision) > value of a real number. For the Windows implementation, > we perform the rounding using MS's _controlfp: > > _controlfp(_RC_UP, _MCW_RC) to round up, for example. > > The assumption is that the double value returned by a function is the closest > double to the exact answer, so that the rounded up and rounded down double > values will enclose the exact value. > > For the case of pow(2.0,3.0), the exact value of 8.0 can be represented > (and appears to be the value returned on other platforms). The returned > result of 7.9999999999999982 suggest that the general pow() is not returning > answers with the precision we are assuming, because the rounded bounds are: > > lower: 7.9999999999999973 > upper: 7.9999999999999991 > > which does not enclose 8.0. > > Do you know if the routines in the 1.0 runtime achieve this precision for the > general pow() function? > > Thanks and cheers, > > Kish >
I fixed issue on trunk with rev. 4067. So my tests for x ^ integer provide now good results. Btw I mean the digits after the decimal-point. Regards, Kai ------------------------------------------------------------------------------ What You Don't Know About Data Connectivity CAN Hurt You This paper provides an overview of data connectivity, details its effect on application quality, and explores various alternative solutions. http://p.sf.net/sfu/progress-d2d _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
