Number * -1

Or

#include <math.h>
Number = abs(Number);

Use the later if you always want it to be positive, the first could
potentially make it go negative if it was positive to begin with...

Ammaross
www.rotf.net

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of cyhawk
Sent: Saturday, April 16, 2005 1:54 PM
To: [email protected]
Subject: Quick question on math in C

Err how would i convert a negitive number to a positive number?
ie -5 to 5
or -754 to 754
in c?

Google was no help cause i have no idea how to form the question ;) Thanks
=)
--
ROM mailing list
[email protected]
Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom

Reply via email to