[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: abs()


>probably this is well-known, but for Sparc, gcc -O compiles a call to
>the standard maths function fabs() as a fabss instruction (this works
>for single or double precision).  Nothing could be easier :). 
>The latest Solaris compilers (f95 at least) will convert the conditional
>( (x) >= 0.0 ? (x) : -(x) ) to an fabss too.

Thanks for the tip, I certainly didn't know this, and this should be a 
great help . . .