On Aug 13, 2013, at 11:01 AM, phoenix <[email protected]> wrote:

This function is used to sort the array, so I think strict floating point comparison is reasonable. The original implementation is wrong because it just returns the result of minus (implicit conversion to int), which makes two floating points that differ less than 1 to equal.

Have I misunderstood your comment?

Nope, I think you got it and I'd agree for sorting an array, the comparison wouldn't need to account for fuzz.

It was more to be aware that those macros exist (and possibly others than may be useful) since we want to reuse code as much as possible.  Maybe just suggesting a quick browse to know what's there and what might be useful.  Being aware that such routines exist is the first step towards reuse.  ;)

It's considerably harder to refactor after the fact, so it's good to browse the code from time to time.  I've been working on the package for more than a decade and still discover/rediscover functionality that ended up duplicated elsewhere because someone didn't bother to look!

This commentary isn't specific to you either.  We all should be looking to browse, reuse, and refactor code for reuse as much as possible (all the time).  It's one of the best ways to accelerate development.

Cheers!
Sean

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to