On Sunday 27 October 2002 7:41 am, Rob Lahaye wrote: > Angus Leeming wrote: > > On Thursday 24 October 2002 12:56 pm, Rob Lahaye wrote: > >>Now I think of it, we may better use "scale = -1" (or any > >>negative value) to indicate the use of width/height. > >> Checking "scale < 0" is safer than checking "scale == 0.0", > >> isn't it? > > > > Nah. What we have is fine. If implemented correctly. > > Angus, > > I don't like the way "scale == 0.0" is implemented now: > > lyx::float_equal(igp.scale, 0.0, 0.05) > > I still prefer using positive value for scaling, otherwise > width/height. Advantages with this are:
But it's incorrect. As I see it, these are the correct implemetations: some_float >= 0.0 lyx::float_equal(some_float, 0.0, 0.05) || some_float > 0.0 some_float > 0.0 !lyx::float_equal(some_float, 0.0, 0.05) && some_float > 0.0 Perhaps those others in the "LyX community" whose brains are active this morning will confirm this. Thereafter, why not write four little helper functions lyx::greater(float var, float val, float tol); lyx::greater_equal(float var, float val, float tol); lyx::less(float var, float val, float tol); lyx::less_equal(float var, float val, float tol); that merely encapsulate the above? Angus