FixedFloatArray.sort() code review
Patrick R. Michaud
pmichaud at pobox.com
Sat Jan 26 01:47:00 UTC 2013
On Fri, Jan 25, 2013 at 04:54:08PM -0800, Jonathan "Duke" Leto wrote:
> Howdy,
>
> I would appreciate a code review here:
>
> https://github.com/parrot/parrot/compare/ffa_sort
>
> One thing that I don't quite feel great about is using == on FLOATVALs.
> What is a better solution? Should I compare them to within some tolerance?
Why not...
return (*i < *j) ? -1 : (*i > *j);
This avoids the test for == altogether.
Pm
More information about the parrot-dev
mailing list