|
From: Daniel J S. <dan...@ie...> - 2006-06-17 04:03:49
|
Petr Mikulik wrote: >>>> 2) BUG 1503114 FIX: 1107709 plot [-1:1] x is plotted with >>>> asymmetric y-axis >>> >>> >>> Floating-point rounding is tricky stuff. It's completely inevitable >>> that sometimes, results will surprise people. All this patch does is >>> move the surprise from a seemingly obvious place to a less obvious one. >>> An axis ending at 2.0000001 has no more business being artificially cut >>> down to 2.0 than one ending at 2.001. >> >> >> I think it does in some cases, and depends on the range. I'll >> illustrate with two ranges determined by the data input. >> >> 2) [-2.0 : 2.0000001] >> >> In the first case, yes definitely, the limits have no business being >> artificially shrunk. > > > What about rounding range limits to the nearest "nice value" in a range of > 100*MachineEpsilon? Well, yes that is an alternative. And it accounts, I think, for most of the problems that would likely arise because of some arithmatic error. I wouldn't mind seeing a formal use of "MachinePrecision". There is the definition "DBL_EPSILON". And it would be nice to have some form of epsilon defined, just like pi is defined, so that user can utilize it in function definitions. However, I still think that rounding to within 1/500 or 1/1000 the axis range--whatever might be beyond the resolution of the display--is a plausible strategy. Could even have a definable variable, visual_precision (default 0.001), meaning to round outward to within abs(max - min)*visual_precision. The user could then turn of the effect by setting visual_precision equal to 0. Anyway, range rounding should be a topic in the documentation and/or part of the "xrange" documentation somewhere. Dan |