tags:

views:

27

answers:

3

I've used fabs before which makes passed values positive, but I need a function which will make number negative ??

+2  A: 

have you tried fabs()*-1

Sander Backus
+2  A: 

Maybe try fabs()*-1?

Joseph Tura
A: 
a = (a > 0) ? -a : a;
Stephen Darlington