On Thu, May 14, 2009 at 7:25 PM, Robert Bradshaw <[email protected]> wrote: > Interesting. In terms of branching on abs, we can do a bitwise and > (but I'm not sure how to write good generic code to do this in both > the floating point and integer case).
In the floating point case, just calling fabs() should do the right thing. In the integer case, it's not just a bitwise and. (Although you can do abs with bitwise operations.) And also, in the integer case, you can't always perform an abs; in a fixed-precision 2's complement format, the absolute value of the most negative integer cannot be represented. Carl _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
