Complex arg-trig functions
Stephen Montgomery-Smith
stephen at missouri.edu
Sun Sep 16 18:26:50 UTC 2012
On 09/16/2012 12:12 PM, Bruce Evans wrote:
> On Sun, 16 Sep 2012, Stephen Montgomery-Smith wrote:
>
>> A style question: do you mind this
>>
>> if (sy==0) ry = copysign(ry, -1);
>> if (A < 1) A = 1;
>>
>> or do you prefer
>>
>> if (sy==0)
>> ry = copysign(ry, -1);
>> if (A < 1)
>> A = 1;
>
> Multiple statements per line are large style bugs, as are missing spaces
> around == operators (I might agree only to omitting spaces around most
> multiplication operators and some addition operators).
>
> Apart from being less readable, multiple statements per line break
> debugging
> using line-based debuggers.
>
> BTW, copysign() is builtin in gcc-4.2 and not broken by a macro in
> <math.h>.
> Otherwise it would be very slow.
I changed it to:
if (sy==0)
ry = -ry;
I happen to know that ry is always positive.
More information about the freebsd-numerics
mailing list